A PowerShell script to list all installed Microsoft Windows Updates

PowerShell Version 2 or Greater required.

Why use this script?

The PowerShell cmdlet ‘get-hotfix’ sometimes does not draw-out ‘installedon’ information. win32-Quickfixengineering class does not have that information either. <SIGH>

What does this script offer?

The above void can be filled by using the good old ‘wmic qfe list’ command. But, the output of the legacy command is mere text and cannot be easily interrogated like objects in PowerShell.

The attached script converts the output string of ‘wmic qfe list’ command into versatile PowerShell objects, which can be used within other scripts.

Note: Do not forget to include the attached powershell script.

The below POSH oneliner lists all updates installed in the last 2 days and tabulates properties: Computername, KBArticle,InstalledOn, HotFixID and InstalledBy.

The below powershell command-line will output details about the hotfix with ID ‘2953522’.

The below POSH gem opens the Knowledge Base webpage for the hotfix with ID ‘2953522’.

Script Content:

The following script can be used as a template to run this function against multiple machines. For this to work you have to enable PSRemoting on all the machines.

Further notes:

As mentioned above the get-hotfix cmdlet and get-wmiobject -class win32_quickfixengineering command does not output the ‘installedon’ date for some updates. The reason for which I’m yet to find out. 

Output of the ‘get-wmiobject -class win32_quickfixengineering‘ command: InstalledOn property NOT available for all updates.

Output of the ‘wmic qfe list’ command: Installedon property available for all updates.

Output of Get-MSHotfix:

Related Articles

1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
Donna Williams
2 months ago

Super like. Thanks for the share.

Would love your thoughts, please comment.x