Get-VM -name MYVM-* | Where { $_.PowerState -eq "PoweredOn" } |
Get-VMGuest |
Select VmName -ExpandProperty Disks | Select VmName, Path, Capacity, @{ N="PercFree"; E={ [math]::Round( ( 100 * ( $_.FreeSpace / $_.Capacity ) ),0 ) } }
| Out-File c:\temp\myvmspace.txt
Note that this is of only the VM's that start with "MYVM-". Change this according to whatever you want ( or remove the -name to just get all vm's, sizes and free space).
No comments:
Post a Comment