Friday, November 4, 2011

powershell script to find VM disk status

foreach ($vm in Get-VM) {
$vm.extensiondata.Config.Hardware.Device |
Where {$_.DeviceInfo.Label -like "Hard Disk*"} |
Select @{N="VMname" ; E={$vm.Name}},
@{N="HD" ;E={$_.DeviceInfo.Label}},
@{N="Mode";E={$_.Backing.DiskMode}}
}

No comments:

Post a Comment