can i get some help on the following
trying to find all vmhoss and get some information
HOST, DATACENTER, Cluster, #CPUS, #CORES/CPU, #NICS, $HBAS
Get-VMHost | Select Name, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}, @{N="Cluster"; e={($_ | Get-Cluster).name}}, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}, @{N="CPU"; e={$_.ExtensionData.Summary.Hardware.NumCpuPkgs}},@{N="CPUcore"; e={$_.ExtensionData.Summary.Hardware.NumCpuCores/$_.ExtensionData.Summary.Hardware.NumCpuPkgs}},@{N="NICs"; e={$_.ExtensionData.summary.hardware.NumNics}}, @{N="HBAs"; e={($_ | Get-VMHostHba).count}}
hi
when I go
Get-VMHost | Select Name, @{N="Datacenter"; e={($_ | Get-Datacenter).name}}
It only shows the hosts but not the DC Name.
Try this
Get-VMHost | Select Name, @{N="Datacenter"; e={(Get-Datacenter -vmhost $_).name}}
*removed select -first 1 (used it for testing)