Missing optional "BrowseOnly" Windows Updates from COM IUpdateSearcher RRS feed

  • שאלה

  • I am using powershell to manually apply certain updates and I think I've encountered a bug, but I'm not sure if it's in Powershell or the COM object. It is reproducible in Windows 7 and Windows 8.1.

    In order to retrieve a list of known optional updates I am using powershell to init COM IUpdateSearcher:

    $Searcher = New-Object -ComObject Microsoft.Update.Searcher
    $Searcher.Online = $false

    ... and then search for those updates using its criterion BrowseOnly=1:

    $Searcher.Search("IsInstalled=0 and IsHidden=0 and BrowseOnly=1 and AutoSelectOnWebSites=0").Updates

    That command returns no results, despite many optional updates being available on the computers I tested. Yet if I remove BrowseOnly=1 the updates with BrowseOnly are returned in the results:

    $Searcher.Search("IsInstalled=0 and IsHidden=0 and AutoSelectOnWebSites=0").Updates

    I can apply a post search filter to get the results with only BrowseOnly:

    $Searcher.Search("IsInstalled=0 and IsHidden=0 and AutoSelectOnWebSites=0").Updates | foreach { if($_.BrowseOnly) { $_ } }

    This seems like a bug to me. Would anyone mind trying to reproduce this issue? To reproduce you will need Windows Update to be aware of at least one optional update that is not installed.

    • נערך על-ידי popchoc יום חמישי 10 אוקטובר 2019 20:24
    יום רביעי 09 אוקטובר 2019 05:12

כל התגובות