Skip to content

Instantly share code, notes, and snippets.

@lhns
Last active June 14, 2019 15:16
Show Gist options
  • Select an option

  • Save lhns/63fca46df0a0c45280e0bc704503f593 to your computer and use it in GitHub Desktop.

Select an option

Save lhns/63fca46df0a0c45280e0bc704503f593 to your computer and use it in GitHub Desktop.
Prevent PC from waking up because of Windows updates
#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