To disable all devices from waking your computer using a PowerShell command on a Windows computer

 To disable all devices from waking your computer using a PowerShell command on a Windows computer 1, you can use the powercfg command with the /devicedisablewake option. Here's how:

  1. Open PowerShell as an administrator.

  2. Type the command powercfg /devicequery wake_armed and press Enter to get a list of devices that can wake up your computer.

  3. For each device listed, type the command powercfg /devicedisablewake "[device name]" and press Enter, replacing "[device name]" with the actual name of the device. This will disable the device from waking up your computer.

If you want to disable all devices at once, you can use the ForEach statement in PowerShell to loop through all devices and disable wake-up for each one. Here's an example:

Get-WmiObject -Class Win32_PnPEntity | Where-Object { $_.ConfigManagerErrorCode -eq 0 } | ForEach-Object { $name = $_.Name; powercfg /devicedisablewake "$name" }

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation