Vitalia Kontanistova
Vitalia Kontanistova

Reputation: 41

How to get all installed Windows updates names and KB numbers with PowerShell?

I need to get all installed Windows updates with PowerShell.

Result should contains update name, KB number, CVE id and severity rating. I had try next scripts: Get-HotFix, wmic qfe list, Get-WmiObject -Class Win32_QuickFixEngineering. But it returns only KB numbers. Also I tried filter installed updates from next script result: Get-ChildItem -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages'. But this script return not all updates.

Next script don't return all installed Windows updates too:

    $Searcher = $Session.CreateUpdateSearcher()
    $HistoryCount = $Searcher.GetTotalHistoryCount()
    $Updates = $Searcher.Search("IsPresent=1").Updates
    $Updates | ForEach-Object {$_}

I have no more ideas and I will be grateful for help.

Upvotes: 4

Views: 12631

Answers (1)

D-squared
D-squared

Reputation: 331

Take a look at the PSWindowsUpdate module in the PowerShell gallery. The Get-WUHistory cmdlet inside this module might just have everything you need.

Upvotes: 2

Related Questions