windows 8 PowerShell script for disabling ALL USB devices "USB power management" under device manager
work company uses windows8 base platform it's application. we're having issues touch screen randomly losing touch no reason @ acer touch screens.
we've been able isolate of problems acer touch screen not being compatible usb power management feature built in windows.
our win7 able use below powershell script disable of usb devices power management without having go through each usb device in device manager.
$hubs = get-wmiobject win32_usbhub$powermgmt = get-wmiobject mspower_deviceenable -namespace root\wmi | {$_.instancename.contains($hubs.pnpdeviceid)}
foreach ($p in $powermgmt)
{
$p.enable = $false
$p.psbase.put()
}
same script doesn't work windows8. any 1 know how modify script above make work on windows8??
thanks!
ok, less hour...lol. i had done yesterday before left work go home.
anyways here's code. i've tested works on windows 8.1 box.
running code on box resulted in $powermgmt not populating data. i suspect same you. i determined reason why, be, qualifier isn't executing , don't understand why. i've looked @ every direction think of, , should work.
anyways, because doesn't, i've re-written code work want.
$hubs = get-wmiobject win32_usbhub $powermgmt = get-wmiobject mspower_deviceenable -namespace root\wmi foreach ($p in $powermgmt) { $in = $p.instancename.toupper() foreach ($h in $hubs) { $pnpdi = $h.pnpdeviceid if ($in -like "*$pnpdi*") { $p.enable = $false $p.psbase.put() } } }
Windows Server > Windows PowerShell
Comments
Post a Comment