Reply to Message

View discussion in a popup

Replying to:
A_S
Enthusiast
Enthusiast

Aha, indeed, it works now.:smileyblush:

There is one downside. The  execution time now takes 10 times longer. Smiley Sad

$row.VMs=[int]$($_.vm.count)
$row.VMsHosted= [string]::Join("|",(Get-View $_.VM| %{$_.Name}))

$row.Hosts=[int]$($_.host.count)
$row.HostsConnected= [string]::Join("|",(Get-View ($_.Host | Select -ExpandProperty Key) | %{$_.Name.Split('.')[0]}))

It seems that these (red) lines retrieve all properties of VM resp. VMHost and than pass only the names back which slows down the total execution time of script.

thanks in advance!

Reply
0 Kudos