Created
January 5, 2023 12:36
-
-
Save everydayintech/15b6d07c95de8bc0d4d87f35d5a7be96 to your computer and use it in GitHub Desktop.
Pause Windows 10 Updates for N Days
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
| [string]$nowDate = [DateTime]::Now.ToString("yyyy-MM-dd'T'HH:mm:ss'Z'") | |
| [string]$UpdatePauseEndDate = [DateTime]::Now.AddDays(7).ToString("yyyy-MM-dd'T'HH:mm:ss'Z'") | |
| [string]$RegNode = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' | |
| Set-ItemProperty -Path $RegNode -Name 'PauseFeatureUpdatesStartTime' -Value $nowDate | |
| Set-ItemProperty -Path $RegNode -Name 'PauseQualityUpdatesStartTime' -Value $nowDate | |
| Set-ItemProperty -Path $RegNode -Name 'PauseUpdatesExpiryTime' -Value $UpdatePauseEndDate | |
| Set-ItemProperty -Path $RegNode -Name 'PauseFeatureUpdatesEndTime' -Value $UpdatePauseEndDate | |
| Set-ItemProperty -Path $RegNode -Name 'PauseQualityUpdatesEndTime' -Value $UpdatePauseEndDate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment