Skip to content

Instantly share code, notes, and snippets.

@Zsoldier
Last active January 14, 2021 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zsoldier/be6e38350fd468daed06455cda5e6288 to your computer and use it in GitHub Desktop.
Save Zsoldier/be6e38350fd468daed06455cda5e6288 to your computer and use it in GitHub Desktop.
PowerCLI: Getting HCL DID, VID, and SVID information.
#Requires -Modules vmware.powercli
$esxihost = "DNSorIPofESXihost"
$vmhost = get-vmhost $esxihost
$vmhostcli = $vmhost | get-esxcli -v2
$pcidevices = $vmhostcli.hardware.pci.list.invoke()
#$pcidevices | where {$_.vendorname -match "Mellanox"}
$HCLData = @()
Foreach ($pcidevice in $pcidevices){
$tempdata = "" | Select VendorName, DeviceClassName, VID, DID, SVID
$tempdata.VendorName = $pcidevice.VendorName
$tempdata.DeviceClassName = $pcidevice.DeviceClassName
$tempdata.VID = '{0:x4}' -f [int]$pcidevice.VendorID
$tempdata.DID = '{0:x4}' -f [int]$pcidevice.DeviceID
$tempdata.SVID = '{0:x4}' -f [int]$pcidevice.SubVendorID
$HCLData += $tempdata
}
$HCLData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment