Perfect. This is what I needed. Got rid of the decimals and rounded up to whole number. much cleaner!
Get-VM |
Where-object{$_.Guest.OSFullName -like "*Windows*"}|
select @{N='VM';E={$_.Name}},
NumCpu,
@{N='MemoryGB';E={[math]::Round($_.MemoryGB)}},
@{N='UsedSpaceGB';E={[math]::Round($_.UsedSpaceGB)}},
@{N='CapacityGB';E={[math]::Round((Get-HardDisk -VM $_ | Measure-Object -Property CapacityGB -Sum).Sum)}} |
Sort-Object -Property MemoryGB |
Format-Table -AutoSize
One last question, looking at the VM and verifying the "CapacityGB" and "UsedSpaceGB", I'm noticing that the VM is showing more space available than what the "UsedSpaceGB" output is reporting. That is, for example, output shows capacity at 50gb and usage close to 50gb. however when I do a visual check on the VM itself, it shows drive only at 35gb used. Where is the discrepancy coming from?
thank you.