Search criteria for PS to use the Microsoft.Update.Searcher COM object

Welcome Forums General PowerShell Q&A Search criteria for PS to use the Microsoft.Update.Searcher COM object

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
1 week, 1 day ago.

  • Author
    Posts
  • #113851

    Participant
    Points: 0
    Rank: Member

    Hi.  I've done several searches, but haven't found examples or the MS docs that I can refer to in developing some code that uses the MS Update Session COM object.  This question is not PS specific.  Let me explain.

    Here's some code that appears in a number of different websites, that offers a way to query the Windows Update service, via the associated COM api:
    $Session = New-Object -ComObject Microsoft.Update.Session
    $Searcher = $Session.CreateUpdateSearcher()
    $Criteria = "IsInstalled=1"
    $Searcher.Search($Criteria).Updates | ft -a title
    What I'm looking for is guidance on the options available that I can pass on to the Search method (see the $Criteria assignment above).
    Searching MSDN is usually a satisfying experience but in this case, I've come up empty.  Any help?
    Thanks.

  • #113950

    Keymaster
    Points: 1
    Rank: Member

    AFAIK, MS has never really documented all the options. It's not really a PowerShell question, though; it might be worth posting someplace with broader coverage, like ServerFault.

You must be logged in to reply to this topic.