This might take you < 1 minute to read.

I wanted to be able to search for a VM and get the free space on the LUN used for that VM. I put out some other data as well…

$vmmserver = "nameofvmmserver"

[System.Collections.ArrayList]$VMDisks = @()
foreach ($server in (Get-SCVirtualMachine -VMMServer $vmmserver | where {$ -match $servername})) {
$hostcluster = 
foreach ($disk in $server.VirtualHardDisks) {
$object = New-Object –TypeName PSObject -Property (
'hostcluster'=(Get-SCVMHost $server.HostName).HostCluster.Name;
'capacity'=([math]::truncate($disk.HostVolume.Capacity/ 1GB)), "GB"-join " ";
'freespace'= ([math]::truncate($disk.HostVolume.FreeSpace/ 1GB)), "GB"-join " ";
$VMDisks| Sort-Object servername