Why the Windows Update API is not giving correct list of installed patches in device

Ramya G 0 Reputation points

I'm using below query to get installed patches

New-Object -ComObject Microsoft.Update.Session).CreateupdateSearcher().Search("IsInstalled=1").Updates | Select-Object Title

I'm comparing the results with control panel. Control panel is listing more patches compared to above query.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,174 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 42,906 Reputation points

    Have you tried using the PSWindowsUpdate module? https://www.powershellgallery.com/packages/PSWindowsUpdate/

    I think the API you referenced only reports on patches installed using MSI.

    0 comments No comments