Hello,
I am trying to generate output that would list all the Advanced Options settings of the iSCSI software adapter. Anyone able to provide me with the commands to do this?
Thanks!
Try like this
$iHBA = Get-vmhost -Name $esxName | Get-VMHostHba -Type IScsi
$iHBA.ExtensionData.AdvancedOptions
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
$iHBA = Get-vmhost -Name $esxName | Get-VMHostHba -Type IScsi
$iHBA.ExtensionData.AdvancedOptions
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Works great. I modified it to grab all of my host.
Question: how do you get it to format into a table. I tried doing a |ft -autosize and it didn't work as expected.
You could do this through multiple calculated properties, but there is an easier way (and shorter) if you want to list all advanced options.
Seen the number of properties in the output, this will most probably not fit on your console screen (unless you set the width to a rather high number).
Best is to list this with Format-List or export the data to an external file.
ForEach-Object -Process {
$obj = [ordered]@{
VMHost = $_.VMHost.Name
}
$_.ExtensionData.AdvancedOptions.GetEnumerator() |
ForEach-Object -Process {
$obj.Add($_.Key, $_.Value)
}
New-Object PSObject -Property $obj
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference