Windows Update PowerShell Module

This function is a piece of PSWindowsUpdate module to manage Windows Update on a computer system running Windows. Whole module contain set of functions to check, download and install updates from PowerShell.

4.6 Star
603,505 times
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Windows 10 Upgrades
    4 Posts | Last post January 04, 2018
    • Hello,
      I have been using this script with my WSUS deployment and it's been working great. However, when it comes to Feature Updates such as moving to 1607 and now 1703, the update is accepted, downloaded, and installed as expected but after reboot the system goes straight to the lock screen and makes no mention of installing updates. So in the end, the update is not applied. Has anyone else experienced this?
    • How are you using it in your WSUS setup?
    • The Script can handle normal updates, but the windows 10 feature updates are different. when they install they are only staging the installation media on the system drive. You then need to trigger the upgrade install to finish the upgrade process. The command I use in my scripting is C:\$WINDOWS.~BT\Sources\SetupHost.Exe /Finalize /Update /InstallFile "C:\$WINDOWS.~BT\Sources\Install.esd"
      Hope this helps
    • droorda,
      Can you elaborate on how you are using that snippet in your script to finalize the feature updates?  This is THE last piece I cannot figure out.  I have tried running the bit you posted, but it doesn't seem to do anything or kick off anything.  I have everything else working to get 1500 machines updated.
  • PSWindowsUpdate v. via NeGet --- Doesn't Work
    4 Posts | Last post December 27, 2017
    • Okay I have narrowed this down a bit.
      I have noticed on recent installations of PSWindowsUpdate, via NeGet, updates are listed, but not downloaded or installed.
      I have gone back to prior installs and they work just fine, - All versions of Windows 10, and even Windows Server 2016.
      I checked the installed version of PSWindowsUpdate, and noticed on systems where it didn't work, it was v. and on versions where it is working, I have v.
      Any ideas where to go from here?
    • This page does not concern the current version of PSWindowsUpdate. All future development is located at - - Which brings you to the most current version. is a compiled version of PSWindows Update. At this time, your scripts will not work with this version. The prior version, does work. "Install-Module -Name PSWindowsUpdate -RequiredVersion"
    • Hi dm1996,
      I had the same issue with some computers but not all. After a quick search I found that it was the PowerShell version installed. PSWindowsUpdate v. needs PowerShell 3 at least. I updated PowerShell version on the computers where I had the trouble and now it's working.
      Hope it will help you.
    • Confirmed same issue. But exists on Windows Server 2016 PowerShell 5.
      SVersion                      5.1.14393.1944                                                                                                                                        
      PSEdition                      Desktop                                                                                                                                               
      PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                               
      BuildVersion                   10.0.14393.1944                                                                                                                                       
      CLRVersion                     4.0.30319.42000                                                                                                                                       
      WSManStackVersion              3.0                                                                                                                                                   
      PSRemotingProtocolVersion      2.3                                                                                                                                                   
      I downgraded to PSWindowsUPdate . It applied updates with progress bar, but hung at $RebootRequired . I had to manually reboot it. Now I see pending Windows Updates in the GUI, but the Get-WUInstall command doesnt seem to see them and takes no action. 
  • Running on 2016
    4 Posts | Last post November 27, 2017
    • Will this run fine on Server 2016?
    • I have it working on 2016, recent past... But currently troubleshooting new problem that rose recently, where the updates are seen but not downloaded or applied.
    • I install the module using 'install-module pswindowsupdate' which downloads from psgallery. I use it on various Windows versions, both for build and ongoing maintenance. However, I have been experiencing the same issue for the last two versions of the module. It will list the updates but not complete the process of download and install. Any input is greatly appreciated to keep this great work going! 
    • See the answer to the question posted above.
  • Filter out firmware update
    1 Posts | Last post November 24, 2017
    • I want to use your module to regularly update drivers on my machines. However, I want to exclude firmware (BIOS/UEFI) updates because they are likely to has for the BIOS password or fail.
      So I'd do it this way:
      $WUlist=Get-WUList -UpdateType Driver -WindowsUpdate 
      $drvList=$drvList=$WUlist | ? DriverClass -ne "Firmware"
      However, where do I go from there? With other updates they'd normally have an UpdateID or a KB, but drivers lack those attributes...
  • Get List of all installed Updates (KBs) local/remote
    1 Posts | Last post November 20, 2017
    • Hi, I like the CMDLet packet very much.
      I am now just wondering how I can get a simple list of all installed KBs on a local or either remote computer?
      Weird thing is: I did this once by using this script but can't get it working again.
      Result should look like this:
      Source          Description     HotFixID  InstalledBy         InstalledOn           
      ------          -----------     --------  -----------         -----------           
      ServerName      Update          KB3192137 NT AUTHORITY\SYSTEM 9/12/2016 12:00:00 AM 
      ServerName      Update          KB4013418 NT AUTHORITY\SYSTEM 4/25/2017 12:00:00 AM 
      ServerName      Update          KB4023834 NT AUTHORITY\SYSTEM 6/14/2017 12:00:00 AM 
      ServerName      Update          KB4035631 NT AUTHORITY\SYSTEM 8/15/2017 12:00:00 AM 
      ServerName      Security Update KB4041691 NT AUTHORITY\SYSTEM 10/17/2017 12:00:00 AM
  • Get-Wulist and WSUS broken?
    1 Posts | Last post November 13, 2017
    • First off, love your module!  It's a huge help.  I was wondering if you could take a look at the Get-Wulist function?  The only way I could get the "WindowsUpdate" parameter to point to WSUS and the "Microsoft Update" parameter to point to MS public servers was to modify the section below.  Thanks!  
      ## Modified this part to point WindowsUpdate to WSUS and MicrosoftUpdate to Microsoft public update servers
      					Write-Debug "Set source of updates to Windows Update"
      					$objSearcher.ServerSelection = 1
      					$serviceName = "Windows Server Update Service"
      				} #End If $WindowsUpdate
      					Write-Debug "Set source of updates to Microsoft Update"
      					$serviceName = $null
      					Foreach ($objService in $objServiceManager.Services) 
      						If($objService.Name -eq "Windows Update")
      							$objSearcher.ServerSelection = 2
      							$objSearcher.ServiceID = $objService.ServiceID
      							$serviceName = $objService.Name
      						}#End If $objService.Name -eq "Microsoft Update"
      					}#End ForEach $objService in $objServiceManager.Services
  • Install Windows 10 1703 patch
    2 Posts | Last post November 01, 2017
    • I'm trying to run this module on a PC with an older version of Windows 10. It ran the initial set of updates available. After a reboot I ran the  Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -verbose command again and was prompted with a 5GB patch for Windows 10 1703. Several hours later after it had downloaded and installed I rebooted when prompted, however the patch hadn't installed. I ran Windows Update via the Settings menu and it installed the already downloaded patch.
      Did I stuff something up or is this module unable to install the major updates? After the 1703 update is installed I intend on updating to the 1709 update, will see if I encounter the same issue.
      Alternatively, is there a way to update Windows 10 from 16xx builds straight to 1709 via Powershell, or is the only way to run the installer via a 1709 ISO?
    • After 1703 finished installing I couldn't even get this module to detect 1709. It only detected after I opened Windows Update in the settings menu. Any ideas?
  • Get-WUList -MicrosoftUpdate Blank?
    2 Posts | Last post October 27, 2017
    • I have a few machines that always return nothing when I run either "Get-WUList -MicrosoftUpdate", or "Get-WUList -IsInstalled". If I run "Get-HotFix" I get a large list of installed updates but I just can't get it to return anything with this module. I've tried running "Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d" first but still the same thing. Anyone else ever seen this? I'm pretty stumped and not sure what to try to fix it. This is a Windows 7 SP1 x64 machine running Powershell 5.
    • All this week I've had no problems.
      Then today I started having the problem you are seeing.
      My original script Installed the module using NuGet
      #Install-Module PSWindowsUpdate -Force
      I removed that and manually downloaded the PSWindowsUpdate PowerShell script and placed the files in:
      My scripts now calls PSWindowsUpdate as follows:
      Import-Module PSWindowsUpdate
      Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -confirm:$false
      Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot
  • Using Get-WUInstall in start-job or -AsJob process is only retriving update but not downloading or installing
    1 Posts | Last post October 10, 2017
    • Using Get-WUInstall in start-job or -AsJob process is only retriving update but not downloading or installing
      Invoke-Command -ComputerName $servers -ScriptBlock { Get-WUInstall -ServiceID "7971f918-a847-4430-9279-4a52d1efe18d" -AutoSelectOnly -AcceptAll -Confirm:$false -IgnoreUserInput  -Verbose | ft | Out-File C:\Temp\PSWindowsUpdate_$(Get-Date -Format mmddyy).log }  -ThrottleLimit 8 -AsJob
      is retrieving only updates in log file but not downloading and installing them? Is this because of it's looking for manual input accept to upgrade your module from online. I get this pop-up message everytime when I run the command using Invoke-WUInstall option.
  • How to auto approve UI which prompting me everytime select to upgrade your module version?
    1 Posts | Last post October 10, 2017
    • How to auto approve UI which prompting me everytime select to upgrade your module version?
11 - 20 of 300 Items