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