Home Windows Updates via PowerShell
Post
Cancel

Windows Updates via PowerShell

Why, What for…

There are times where it is more convenient to run windows updates via PowerShell. In fact, there are times where it is the only way to do updates, specially when the pesky service is malfunctioning

Setup

  1. Open PowerShell as admin
    (right-click on the start menu and select “Windows PowerShell (Admin)”)
    or search for “PowerShell”, then right-click on it and select “Run as Administrator”

  2. Set the execution policy to Remotely Signed
    (paste the following command and press Y or A to agree and press ENTER)

    1
    
     Set-ExecutionPolicy RemoteSigned
    

Getting and Intalling Updates

  1. Install the PSWindowsUpdate module
    1
    
    Install-Module PSWindowsUpdate
    
  2. To get the list of pending Windows Updates
    1
    
    Get-WindowsUpdate
    
  3. Finally to Install the pending Updates
    1
    
    Install-WindowsUpdate
    

    Here you can press A to agree to all or Y or ENTER to agree to the individual ones
    PowerShell

This post is licensed under CC BY 4.0 by the author.