Facebook Twitter Instagram
    • Privacy Policy
    • Facebook Page
    • Channel
    • Twitter
    • Sitemap
    Facebook Twitter Instagram
    TechulkTechulk
    • Menu
      • Blogging
      • Android
      • Apps
      • Rooting/Flashing
      • Games
    • How-To
    • Troubleshooting
    • Reviews
    • News
      • Latest
      • Trending
      • Around The Web
    • Affiliate Disclosure
    TechulkTechulk
    Home»How-To»Download and Install Windows Update with Powershell
    How-To

    Download and Install Windows Update with Powershell

    Shravan DasBy Shravan DasMay 23, 2020Updated:July 14, 2020No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn WhatsApp Pinterest Email

    Windows 10 Powershell is a very powerful command-line tool.

    With the latter, you can very easily download and install Windows Update.
    This goes even further because you can control Windows Update such as restart expectations to install the updates.

    This article gives you most of the Powershell commands and cmdlets to download and install Windows Update updates.

    Contents

    • Introduction
    • WindowsUpdateProvider
      • Check for updates
      • Install updates
    • Windows Update PowerShell Module
      • Installation
      • Powershell Command-List
      • Check for updates
      • Install updates
      • Install an update on a remote PC
      • Block and Hide an update
      • Uninstall an update

    Introduction

    There are two solutions for finding and installing PowerShell updates:

    • WindowsUpdateProvider: This group of cmdlets is included by default in Windows 10 and Windows Server 2018.
    • PSWindowsUpdate: Additional module which offers additional functionalities such as listing the update history.

    This article details these two groups of Powershell commands.

    To list and display the latest updates installed, the command to use is:

    gwmi win32_quickfixengineering |sort installedon -desc

    WindowsUpdateProvider

    Here is the list of available commands:

    • Start-WUScan: Check for available updates.
    • Install-WUUpdates: Download and install updates.
    • Get-WUIsPendingReboot: Indicates if an update is waiting to install at the next reboot. It returns true in this case.
    • Get-WULastInstallationDate: Returns the date of the last installation of an update.
    • Get-WULastScanSuccessDate: Returns the date of the last successful Windows Update verification.
    • Get-WUAVersion: Returns the version of the Windows Update client.

    Check for updates

    The Start-WuScan command is used to check for updates.
    If you do not specify any parameters, all updates that apply to the system will appear in the results.

    To filter on software updates:

    Start-WUScan -SearchCriteria "Type='Software' AND IsInstalled=0"

    But it can work on a remote computer.

    $u = Invoke-Command -ComputerName MonPC -ScriptBlock {Start-WUScan -SearchCriteria "UpdateId='' AND IsInstalled=1"} -Credential administrateuradmin

    $ u then contains the list of available updates.

    Install updates

    Then we use the Powershell command Install-WUUpdates to install the update.

    Then to install the pending updates.

    $Updates = Start-WUScan
    Write-Host "Updates Found: " $Updates.Count
    Install-WUUpdates -Updates $Updates

    Finally, the command to update a remote PC:

    $cs = New-CimSession -ComputerName MonPc -Credential Credential admin admin
    Install-WUUpdates -Updates $u -CimSession $cs

    The parameter -DownloadOnly allows you to download the update without installing it.

    Windows Update PowerShell Module

    Installation

    By default PowerShell does not allow you to control Windows Update.

    But we can extend these functions by installing the Windows Update PowerShell Module.

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted
    Import-Module PSWindowsUpdate

    Powershell Command-List

    Here are the Powershell cmdlets available to control Windows Update:

    • Download-WindowsUpdate (aka Get-WindowsUpdate -Download) : Download updates
    • Get-WUList: Get a list of available updates that meet certain criteria.
    • Get-WUInstall, Install-WindowsUpdate: Download and install updates.
    • Add-WUOfflineSync: Save the scanner service offline
    • Get-WUServiceManager: Display the configuration of the Service Manager.
    • Get-WUHistory: Get a list of previous updates.
    • Get-WUInstallerStatus: Check the status of the Windows Update installer.
    • Get-WURebootStatus: Check the restart status of Windows Update and offers to restart the PC.
    • Get-WUUninstall: Uninstall the update.
    • Hide-WindowsUpdate (alias Get-WindowsUpdate -Hide: $ false): hide an update.
    • Remove-WUOfflineSync: Unregister the offline scanner service.

    Check for updates

    Here is the Powershell command to list the Windows Update updates awaiting installation:

    Get-WUlist

    And to list the updates from a remote PC:

    Get-WUList -ComputerName NomDeLaMachine

    Install updates

    Here is the command to install all the updates:

    Install-WindowsUpdate -AcceptAll

    And to force the restart:

    Install-WindowsUpdate -AcceptAll -AutoReboot

    But also to install specific updates in PowerShell:

    Get-WindowsUpdate -KBArticleID KB2267602, KB4533002 -Install

    And finally to exclude updates, here is the PowerShell command:

    Install-WindowsUpdate -NotCategory "Drivers" -NotTitle OneDrive -NotKBArticleID KB4011670 -AcceptAll -IgnoreReboot

    Install an update on a remote PC

    And if you want to install Windows Update updates by PowerShell on remote PCs:

    $Serveurs= "serveur1, serveur2, serveur3"
    Invoke-WUJob -ComputerName $ServerNames -Script {ipmo PSWindowsUpdate; Install-WindowsUpdate -AcceptAll | Out-File C:WindowsPSWindowsUpdate.log } -RunNow -Confirm:$false

    Block and Hide an update

    $HideList = "KB4489873", "KB4489243"
    Get-WindowsUpdate -KBArticleID $HideList –Hide

    Finally to list the hidden updates:

    Get-WindowsUpdate –IsHidden

    Finally to unlock updates, here are two different Powershell commands:

    Get-WindowsUpdate -KBArticleID $HideList -WithHidden -Hide:$false
    Show-WindowsUpdate -KBArticleID $HideList

    Uninstall an update

    To uninstall an update with PowerShell, we use Get-WUUninstall:

    Get-WUUninstall -KBArticleID KBXXX
    How-To windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr WhatsApp Email
    Shravan Das
    • Website
    • Facebook
    • Twitter
    • Instagram
    • LinkedIn

    A Tech Geek who loves to write about WordPress blogging, How-To's, and fixing errors. He founded techulk with the sole purpose of providing visitors the exact information they need with simple and step-by-step working explanations.

    Related Posts

    Canva Pro: Your Ultimate Online Design Tool (2024)

    December 10, 2024

    A Beginner’s Guide to Understanding Roku and How It Works

    April 24, 2023

    Does Panda Express take Apple pay

    March 10, 2023

    Does Safeway take Apple Pay?

    March 1, 2023

    Does Wingstop Take Apple Pay

    February 21, 2023

    Does Home Depot Take Apple Pay?

    February 17, 2023
    Add A Comment

    Leave A Reply Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    – Ads –
    Recent Comments
    • Shravan Das on What is CAMRIP, DVDRIP, HDTS, HDTV & other releases?
    • Gumby on What is CAMRIP, DVDRIP, HDTS, HDTV & other releases?
    • ajay kumar on Kerala vision broadband Review & Plans
    • Ravindran on Change Jio fiber login password | Easy Guide 2020
    – Ads –
    Facebook Twitter YouTube Instagram
    • Privacy Policy
    • Facebook Page
    • Channel
    • Twitter
    • Sitemap
    © 2025 Techulk

    Type above and press Enter to search. Press Esc to cancel.