Get-VM VmName | Get-HardDisk |
where {"RawPhysical","RawVirtual" -contains $_.DiskType -and
"Physical","Virtual" -contains (Get-ScsiController -HardDisk $_).BusSharingMode} |
Select filename, @{N='VM';E={$_.Parent.Name}},
Name,
DeviceName,
CapacityGB,
DiskType,
ScsiCanonicalName,
@{N='BusSharing';E={(Get-ScsiController -HardDisk $_).BusSharingMode}},
@{N='SCSIid';E={
$hd = $_
$ctrl = $hd.Parent.Extensiondata.Config.Hardware.Device | where{$_.Key -eq $hd.ExtensionData.ControllerKey}
"$($ctrl.BusNumber):$($_.ExtensionData.UnitNumber)"
}} | export-csv vm.csv | out-gridview
where {"RawPhysical","RawVirtual" -contains $_.DiskType -and
"Physical","Virtual" -contains (Get-ScsiController -HardDisk $_).BusSharingMode} |
Select filename, @{N='VM';E={$_.Parent.Name}},
Name,
DeviceName,
CapacityGB,
DiskType,
ScsiCanonicalName,
@{N='BusSharing';E={(Get-ScsiController -HardDisk $_).BusSharingMode}},
@{N='SCSIid';E={
$hd = $_
$ctrl = $hd.Parent.Extensiondata.Config.Hardware.Device | where{$_.Key -eq $hd.ExtensionData.ControllerKey}
"$($ctrl.BusNumber):$($_.ExtensionData.UnitNumber)"
}} | export-csv vm.csv | out-gridview
No comments:
Post a Comment