If you don’t want a device (Example XBox Controller) to be turned off, you can unset the corresponding checkbox in the Device Manager (“Allow the computer to turn off this device to save power”) or if you want to do it automatically, you can set this registry value:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_xxxx&PID_xxx\[ID]\Device Parameters\WDF\IdleInWorkingState = 0 (REG_DWORD)
Example XBox Controller:
Get-Item 'HKLM:\SYSTEM\CurrentControlSet\Enum\USB\VID_045E&PID_02DD\*\Device Parameters\WDF\'
Name Property
—- ——–
WDF IdleInWorkingState : 1
WakeFromSleepState : 1
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Enum\USB\VID_045E&PID_02DD\*\Device Parameters\WDF\' | Where-Object {
#if ($_.IdleInWorkingState -eq 1)
#{
Set-ItemProperty -path $_.PSPath -Name "IdleInWorkingState" -Value "0" -type DWord #-WhatIf
#}
}
xxxx/yyyy of course replace with the values from the respective device.
After reboot, the checkbox in the GUI is gone and the device is on Always On.