Tag Archives: space

Get Total Space Used by VMs

The other day I was in need of finding out how much space my VMs actually take up.  Below are the commands I used in the vSphere PowerCLI to get that information.

$TotalDisk = 0;
#Get Sum of all Disks in TBs
Get-VM | Get-HardDisk | %{$TotalDisk+=[int]$_.CapacityKB}
$TotalDisk = $TotalDisk/1024/1024/1024;
echo "$TotalDisk TBs"