finding deviceid from a list
hello,
i have following script not working. i'm trying find hardware id gpus. can find hardware id can't manage compare predefined list
this output variable $hwidno
\\win-tip0j3116ev\root\cimv2:win32_pnpentity.deviceid="pci\\ven_1002&dev_683d&subsys_25561458&rev_00\\4&bff9516&0&0010"
can guide me right direction?
thank you.
$hwid_intel = (
"8086&dev_041a",
"1002&dev_683d"
)
$hwid = get-wmiobject win32_pnpentity | where-object {$_.classguid –match “{4d36e968-e325-11ce-bfc1-08002be10318}”}
$hwidno = $hwid.deviceid
if ($hwid_intel -like $hwidno) {write-host "true"}
write-host "3 - $hwid"
write-host "3 - $hwidno"
write-host "4 - $hwid_intel"
try below code , let me know results.
$hwid_intel = ("8086&dev_041a","1002&dev_683d")
$hwid = get-wmiobject win32_pnpentity | where-object {$_.classguid –match “{4d36e968-e325-11ce-bfc1-08002be10318}”}
$hwidno = $hwid.deviceid
foreach ($x in $hwid_intel) {
if ($x -like "*$hwidno*") { "$x true"}
}
Windows Server > Windows PowerShell
Comments
Post a Comment