See which devices can wake the machine ```powershell powercfg -devicequery wake_armed ``` Prevent all HID devices from waking the machine. ```powershell powercfg -devicequery wake_armed | select-string -pattern "HID" | foreach { powercfg /devicedisablewake $_ } ``` ## Sleeping There doesn't seem to be a way without disabling hibernation. ```powershell powercfg -H off rundll32 powrprof.dll,SetSuspendState Sleep ``` (if hibernation is enabled, the machine will hibernate instead of sleeping) ### No Sleep Option I did a fresh install of Windows 10 onto a [Lenovo T470s](/aw/pc/lenovo/LenovoT470s). I hadn't installed the graphics driver (so Windows was using the 'Microsoft Basic Display Driver') and there was no option to sleep. Installing this driver (the file is named `r0fiv17w.exe`) fixed the issue. When I originally got this laptop (refurb off eBay), there was an older graphics driver installed which caused issues playing videos on e.g. Youtube. ## External links [article at devblogs.microsoft.com](https://devblogs.microsoft.com/scripting/get-windows-power-plan-settings-on-your-computer-by-using-powershell/)