So you want to run Windows Update with PowerShell? Heck yes you do! And once you do, it's only one more step to make it a Run Script!
Script on GitHub: Run-WindowsUpdates.ps1
Related: How To Create List of Variables in Run Scripts
So here is just running the PowerShell. Default provides list of available updates:
Adding some Parameters allows you to Install & Reboot if you want
Adding to a Run Script might not be the best idea in the world, but sometimes you make due with the tools you have [Access to].
Running the Defaults (as shown above), you can see several updates that are available, the return is pretty quick. Now when I re-run with Updates Enabled, it will take quite a bit longer to download and install. I'll also trigger the CM Restart
So after I triggered the Script, it took a VERY long time. 20+ minutes. You can see from the results below that it downloaded the 4 updates and then applied them. They required a reboot, so it ran the CM Restart Function since I set that to True. If I had left it false, it would have just installed the updates without triggering any reboot.
On my endpoint, It did get the Reboot Notification, and it is in the Tray
Posted on GARYTOWN.COM