Last active
January 14, 2021 17:43
-
-
Save Zsoldier/be6e38350fd468daed06455cda5e6288 to your computer and use it in GitHub Desktop.
PowerCLI: Getting HCL DID, VID, and SVID information.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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