Last active
November 24, 2023 13:39
-
-
Save weeyin83/54b4e9e824115756c068d9d0ce584c7b to your computer and use it in GitHub Desktop.
Update Windows From PowerShell
This file contains 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
#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