Monday, September 22, 2008

VM Inventory with powershell

Default get-vm will provide you with a list of VMs and info on cpu/power state/memory. To get hdd info you need to run get-harddisk.

Problem with get-harddisk is that there is no default column for servername. Use the following powershell command to get the info for hdd w server name.

get-vm | select name, {$_.harddisks | % {$_.capacitykb}}