Last active
June 14, 2019 15:16
-
-
Save lhns/63fca46df0a0c45280e0bc704503f593 to your computer and use it in GitHub Desktop.
Prevent PC from waking up because of Windows updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -RunAsAdministrator | |
| # https://superuser.com/a/1414945/663027 | |
| param ([bool]$value = $false) | |
| New-Item -Force -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "WindowsUpdate" | |
| New-ItemProperty -Force -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate" -Name "AUPowerManagement" -PropertyType DWord -Value (&{If ($value) {1} Else {0}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment