Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

That list format is driven by the size of your screen.
To export to a CSV, just pipe the result to Export-Csv

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}} |

   Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture


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

Reply
0 Kudos