PowerShell script to list all installed Microsoft Windows Updates

A PowerShell script to list all installed Microsoft Windows Updates.Script Updated:17/12/2014: If command 'wmic qfe list' returns $null or '' then use 'Monday 1 January 0001' as date.  PowerShell Version 2 or Greater required.Why use this script?The PowerShell cmdlet 'get-hotfix'

Get-MSHotfix.ps1
 
 
 
 
 
3.5 Star
(31)
55,139 times
Add to favorites
Windows Update
6/20/2018
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • No output generates
    1 Posts | Last post November 27, 2018
    • Executed the power shell, i dnt see any output generated while running the below command. 
      appreciate your help
      
      .\Get-MSHotfix.ps1|Where-Object {$_.Installedon -gt ((Get-Date).Adddays(-14))}|Select-Object -Property Computername, KBArticle,InstalledOn, HotFixID, InstalledBy|Format-Table
  • No output :(
    2 Posts | Last post July 01, 2018
    • Win 10 Enterprise here
      wnic qfe list works fine
      Also Get-WindowsPackage -Online| where packagestate -eq installed | select PackageName,Description,InstallTime | Out-GridView 
      
      but can't get ANYTHING from this function, either with .\get-mshotfix or with  .\Get-MSHotfix|Where-Object {$_.Installedon -gt ((Get-Date).Adddays(-100))}|Select-Object -Property Computername, KBArticle,InstalledOn, HotFixID, InstalledBy|Format-Table
      
      :(
    • Are you getting any errors. Run the script and invoke the function line . .\get-mshotfix
      
      
      Regards,
      Topaz
      Principal Engineer : www.sccmtspsi.com
      *************
      Exponentially increase success rates of SCCM windows 10 builds and upgrades. Upgrade 100’s of desktops/laptops/tablets everyday for just 1$ a day | Your very own automated SOE specialist bot. www.sccmtspsi.com
  • How to get the same report for in remote servers & servers in different domain
    2 Posts | Last post July 01, 2018
    • Hi,
      
      Excellent script, works perfectly fine with my system. I am trying to get the same for servers via remote which is not happening. Could you please help me with this.
    • Is WinRM enabled on the servers. Try running an other script against the Sever(s).
      
      Regards,
      Topaz
      Principal Engineer : www.sccmtspsi.com
      *************
      Exponentially increase success rates of SCCM windows 10 builds and upgrades. Upgrade 100’s of desktops/laptops/tablets everyday for just 1$ a day | Your very own automated SOE specialist bot. www.sccmtspsi.com
  • Error Unexpected token 'in $Outputs' in expression or statement. + CategoryInfo : ParserError: (in $Outputs:String) [], ParseException + FullyQualifiedErrorId : UnexpectedToken + PSComputerName : XXXXX
    2 Posts | Last post July 01, 2018
    • Hi Topaz, I have modified the script based on my requirement. I am running it for multiple machines but getting error for random machines.
      Unexpected token 'in $Outputs' in expression or statement.
          + CategoryInfo          : ParserError: (in $Outputs:String) [], ParseException
          + FullyQualifiedErrorId : UnexpectedToken
          + PSComputerName        : XXXXXXX
      
      Output of these are skipped and are not included in Output fine. Please suggest
    • Hi Eddie,
      
      Does the script run well when it runs on a single machine (Local and remote)?
      
      Regards,
      Topaz
      Principal Engineer : www.sccmtspsi.com
      *************
      Exponentially increase success rates of SCCM windows 10 builds and upgrades. Upgrade 100’s of desktops/laptops/tablets everyday for just 1$ a day | Your very own automated SOE specialist bot. www.sccmtspsi.com
  • I'm the only one with...
    1 Posts | Last post December 01, 2017
    • the situation, that the system doesn't know get-mshotfix. Instead, it's get-hotfix.
      I can only imagine, that all this is all fake. At least one should have the problem with a command that cannot be found...
      If it's no fake, it's sad that Microsoft doesn't have other things to do instead of changing command names :-(
      
  • Date issue
    1 Posts | Last post November 10, 2017
    • FYI, I had to comment out the formatting on the InstalledOn date of the records in order to get date-filtering to work.
      
      InstalledOn = Get-Date($Dateis)#-format "dddd d MMMM yyyy"
      
      Prior to doing this, the function would ignore the date filtering like in your example - and showed all updates.
  • all Updates
    1 Posts | Last post September 02, 2017
    • Hello nice script I am trying to get a count of all updates when I used the get-hotfix don't match when I got to the bottom of windows update installed in control panel . Any help will be appreciated . Thanks in advance 
  • Remote Exectution and filter on last 30 days Hotfixes.
    1 Posts | Last post August 09, 2016
    • This script works fine on reporting the hotfixes. How do I execute the script by calling in the function and then filtering the output based on patches applied last 30 days. 
      
      
      
      $scriptBlock = {
             
          Get-MSHotfix |
          Where-Object $_.Installedon -gt ((Get-Date).Adddays($null1)) |
          ft -HideTableHeaders
          
      }
      
      
          Invoke-Command -ComputerName "server1" -ScriptBlock $scriptBlock  |ft -HideTableHeaders
      
      I tried to do it in scriptblock and got below errors.
      
      Where-Object : Cannot validate argument on parameter 'Property'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
  • How do I get output?
    3 Posts | Last post June 26, 2016
    • Have a small amount of PowerShell knowledge. How do I get this to output something? I've tried running it both in a PowerShell window and in Sapien PowerShell Studio. Using my local computer as the target. Tried using the command:
      .\Get-MSHotfix.ps1
      and also 
      .\Get-MSHotfix.ps1 -ComputerName [my computer name]
      
      Nothing I've tried produces any output and I don't see any Help info in the script itself. 
      
      Thanks.
    • run the following in Powershell.
      
      . .\Get-MSHotfix.ps1
      
      Then run 
      
      Get-MSHotfix
    • There should be a space in-between the two dots.
  • Does not report Wusa Packages
    2 Posts | Last post April 28, 2016
    • This script does not report .msu packages installed with wusa (Windows Update Standalone Installer).
      
      Get-WindowsPackage -Online 
      
      is needed to list this packages. Maybe you can include this in your script?
      
      Example to show this packages:
      
      Get-WindowsPackage -Online| where packagestate -eq installed | select PackageName,Description,InstallTime | Out-GridView
    • Get-WindowsPackage is only available in windows 8 and above.
1 - 10 of 19 Items