PowerTip: Quickly Find System Updates via PowerShell

PowerTip: Quickly Find System Updates via PowerShell

  • Comments 6
  • Likes

Summary: Use Windows PowerShell to identify updates applied to a computer system.

Hey, Scripting Guy! Question How can I find which updates are applied to my computer?

Hey, Scripting Guy! Answer 

Use the Get-Hotfix cmdlet. To find updates, use the Description parameter and specify Update:

Get-HotFix -Description Update

To find a specific hotfix by ID number, use the Id parameter:

Get-HotFix -id kb2741530 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • So this one let's you know where you're outdated? Does it also include Applications or is it just like Windiws Updater?

  • *Windows

  • It is a wrapper around this:

    gwmi win32_quickfixengineering

    I is only for hotfixes for WIndows and Microsoft applications like Office that are serviced by WIndows Update or are installed via a KB.

    To see this run the following:

    Get-Hotfix|?{$_.description}|select description

  • Any way to "install" updates, not just see what was installed?

  • gwmi win32_quickfixengineering and Get-Hotfix do not return the InstalledOn date for all patches on my Windows 7 machine (up to date with patches, POSH 3).

    In contrast, the DOS command wmic qfe does return the InstalledOn date for all patches, so it looks like there is a bug in the way that POSH handles win32_quickfixengineering.

  • I wrote this script to parses key details from the "wmic qfe" command, so that I have the InstalledOn date for all items.

    # Use WMIC to get a list of installed patches

    $wmic = wmic qfe

    foreach ($line in $wmic) {

       # HotFix ID

       if ($line -match "\bKB(\d*)\b") {

           $HotFixID = $Matches[0]

       }

       # InstalledOn

       if ($line -match "\b(\d{1,2})\/(\d{1,2})\/(\d{4})\b") {

           $InstalledOn = $Matches[0]

       }

       # Description

       if ($line -match "\b(Update|Security Update|Hotfix|Service Pack)") {

           $Description = $Matches[0]

       }

       $details = $HotFixID + "  " + $InstalledOn + "  " + $Description

       Write-Output $details

    }