Quantcast
Channel: Virtual Machine Manager – General forum
Viewing all articles
Browse latest Browse all 728

All Virtualmachines C drive capacity

$
0
0

Hi , I am looking for a script which gives name of VM along with the capacity of C drive(all IDE). I had written a script which unfortunately not working. Could you please helm me in this?

$vms = (Get-SCVirtualMachine -All)
foreach($vm in $vms)
{
$vmname = $vm.name 
$vhd = ($vm.virtualdiskdrives | where{$_.bustype -eq "ide"}).virtualharddisk
$maxsize = ($vhd.maximumsize)/1GB
$output = @{"$vmname" = "$maxsize"}
$output | Export-Csv c:\path -Append
}

Thanks in Advance


Viewing all articles
Browse latest Browse all 728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>