Get Provisioned Space Averages and sums

Great bit of scripting from another blog http://blog.eight02.com/2012/03/using-powercli-to-find-total-space.html

I was looking for a way to find the sum of Provisioned Space in GB for a cluster using PowerCLI when I stumbled upon this great link.

I tweaked it to specify the exact properties that I needed ProvisionedSpaceGB within Get-VM and came up with this one liner:

[System.Math]::Round((Get-Cluster *mgmt* | get-vm | measure -Property ProvisionedSpaceGB -Sum).sum, 2)

And what does this produce?

A single number 1237.15, we can add any string variable to beginning of the one-liner to add context to the number but a really useful command nonetheless.



Comments