Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

Try like this

Get-VM | Get-HardDisk |

Select @{N='VM';E={$_.Parent.Name}},

  @{N='VM Uuid';E={$_.Parent.ExtensionData.Config.Uuid}},

  Name,

  Filename,

  CapacityGB,

  @{N='VMDK Uuid';E={$_.ExtensionData.Backing.Uuid}},

   @{N='SCSIid';E={

   $hd = $_

   $ctrl = $hd.Parent.Extensiondata.Config.Hardware.Device | where{$_.Key -eq $hd.ExtensionData.ControllerKey}

   "$($ctrl.BusNumber):$($_.ExtensionData.UnitNumber)"

   }},

   @{N='Controller#';E={(Get-ScsiController -HardDisk $_).UnitNumber}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos