Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@weeyin83
Last active November 24, 2023 13:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save weeyin83/54b4e9e824115756c068d9d0ce584c7b to your computer and use it in GitHub Desktop.
Save weeyin83/54b4e9e824115756c068d9d0ce584c7b to your computer and use it in GitHub Desktop.
Update Windows From PowerShell
#TLS Setting
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#Trust PowerShell Gallery - this will avoid you getting any prompts that it's untrusted
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
#Install NuGet
Install-PackageProvider -name NuGet -Force
#Install Module
Install-Module PSWindowsUpdate
#Check what updates are required for this server
Get-WindowsUpdate
#Accept and install all the updates that it's found are required
Install-WindowsUpdate -AcceptAll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment