VMWare PowerCLI Virtual Machine Information
28 Dec 2010After having connected to your VC server:
Get-VM | select-Object Name, @{ Name="NumCPU"; Expression={ ($_ | measure-object -property NumCPU -sum).Sum }}, @{ Name="StorageGB"; Expression={ ($_ | get-harddisk | measure-object -property CapacityKB -sum).Sum / 1024 / 1024 }}, @{ Name="MemoryGB"; Expression={ ($_ | measure-object -property MemoryMB -sum).Sum / 1024 }}
| Format-Table -AutoSize
This produces the name of each vm with the corresponding size in gigabytes, number of vCPU's and memory in gigabytes.