This article will show you how I patch my Windows Nano Server 2016 Server using 3 PowerShell scripts.
I’ve used those scripts for a client update job and the result was amazing.
The process Is built from 3 scripts:
- SCAN_UPDATES.PS1 – Check for updates
- INSTALL_UPDATES.PS1 – Install available updates
- CHECK_INSTALLED_UPDATES.PS1 – Check Installed updates
To get started, First connect to your Nano Server using PowerShell.
Next copy the scripts to your Nano Server or use PSedit to create and copy:
- Copy Files To A Nano Server Using Remote PowerShell 5
- Edit Remote PowerShell Scripts Using PSEdit And ISE
Once connected check for updates using script 1:
If updates available run script #2 to Install them:
#INSTALL UPDATES
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates Restart-Computer; exit
Once done, I run script number #3 to check for Installed updates
Download Scripts (change .TXT to .PS1: