I have a working script to disable 4 usb joysticks using their respective InstanceID's
$pnpIds = 'HID\VID_0079&PID_0006\7&1699A0E&198&0000', 'HID\VID_0079&PID_0006\7&5438EB5&19D&0000', 'HID\VID_0079&PID_0006\7&390C5738&17D&0000','HID\VID_0079&PID_0006\7&2652A693&16C&0000'
foreach ($pnpId in $pnpids) {
Disable-PnpDevice -InstanceId $pnpId -Confirm:$false
}
It works fine when executing, problem is upon reboot the ID's change.. only 3 characters change at the end in between the "&" characters (HID\VID_0079&PID_0006\7&1699A0E&198&0000 The rest remains the same. Anyway to use wildcards for those 3 characters?
If not is there a way to write a script that will fetch the current InstanceID's for the USB joysticks then disable/enable them with the script I currently am using? Way out of my league here..