I was using below powershell script to update windows https://gallery.technet.microsoft.com/scriptcenter/Execute-Windows-Update-fc6acb16#content

It works fine for Windows updates. But it does not install/update the Microsoft Updates

I am looking for script which automates Both important and optional updates as shown below.

enter image description here

How can I alter this script? (Script can be found in above link)


This module can be configured to use Microsoft update.

Force Windows update, using Microsoft update, accept all, and reboot

Import-Module PSWindowsUpdate
# register ms update service
Add-WUServiceManager -ServiceID "7971f918-a847-4430-9279-4a52d1efe18d" -Confirm:$false
Install-WindowsUpdate -AcceptAll -MicrosoftUpdate -AutoReboot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.