I am trying to use the following code to export VM hard disk size to a Excel file. The script is from the VI toolkit blog.
$datastoreExp = @{N="Datastore"; E={ ($_ | get-datastore | select-object -first 1).Name }}
$diskSizeExp = @{N="Total Disk"; E={ ($_ | get-harddisk | measure-object -property CapacityKB -sum).Sum }}
get-vm | select Name, $datastoreExp, $diskSizeExp | sort -property datastore,"Total Disk" -
Any help is greatly appreciated
David Strebel
www.david-strebel.com
If you find this information useful, please award points for "correct" or "helpful"