hello all,
We have multiple vCenters servers I'm trying is to collect some basic data (for start).
PS C:\> foreach ($vc in $global:DefaultVIServers) {
$esxi = get-vmhost -Server $vc
[PSCustomObject]@{
Name = $esxi.name
ConnectionState = $esxi.ConnectionState
PowerState = $esxi.PowerState
Version = $esxi.Version
}
}
I'm not sure why I get the data in { }.
Name ConnectionState
---- ---------------
{esx01.local, esx02.local, esx03.local, esx04.local} {Maintenance, Connected, Connected, Connected}
{prod01.local, prod02.local, prod03.local, prod04.local} {Connected, Connected}
{dns01.local, dns02.local, dns03.local, dns04.local} {Connected, Connected, Connected, Connected...}
{dc01.local, dc02.local, dc03.local, dc04.local} {Connected, Connected, Connected, Connected...}
{test01.local, test02.local, test03.local, test04.local} {Connected, Connected, Connected, Connected}
am I missing something obvious here or I'm overthinking it?
Thanks, Mike