Wednesday, 17 May 2017

Windows Updates via Powershell

This requires Powershell V5. The powershell script to install the module is:

$psversion = $PSVersionTable.PSVersion.Major

if ($psversion -ge 5){

Install-PackageProvider -Name NuGet -Force

Install-Module -Name PSWindowsUpdate -Force -Scope AllUsers

Get-WUServiceManager

}else{
echo "Error, PS is out of date"
}



Then, to run it simple use:

"Get-WuInstall -AcceptAll -IgnoreUserInput -AutoReboot -Confirm:$false -nottitle 'preview' -updatecount 30" 

(Update count just limits the amount it does at once, so if there is an error with one it doesn't undo them all. Good for computers very out of date.)



The github for this module is located at:

https://github.com/joeypiccola/PSWindowsUpdate

No comments:

Post a Comment

Graylog 6.3.1 on Synology DSM 7.2.2

Below is the Docker Compose script to setup Graylog. Copy and paste this then make a new Project with this script. The default password I us...