ryan-jan / MSCatalog

PowerShell module for searching and downloading offline updates from https://www.catalog.update.microsoft.com
MIT License
58 stars 16 forks source link

-strict paramter stopped working #26

Closed ITSNOTSTUPIDIFITWORKS closed 2 years ago

ITSNOTSTUPIDIFITWORKS commented 2 years ago

Get-MSCatalogUpdate -Search $searchstring -SortBy LastUpdated -Descending -IncludeFileNames -Strict

Exception: C:\Program Files\PowerShell\Modules\MSCatalog\0.27.0\Public\Get-MSCatalogUpdate.ps1:106
Line |
 106 |  …             $_.SelectNodes("td")[1].innerText.Trim() -like "*$Search* …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot index into a null array.
ITSNOTSTUPIDIFITWORKS commented 2 years ago

Fix: add $_.Id -ne "headerRow" -and in Get-MSCatalogUpdate.ps1

$_.Id -ne "headerRow" -and $_.SelectNodes("td")[1].innerText.Trim() -like "*$Search*"

xxbiohazrdxx commented 2 years ago

Are you using the latest version from here, or the PSGallery? This should have been fixed by https://github.com/ryan-jan/MSCatalog/commit/003a30587f245076f83d25374710a47a613cfe54 but that has not been pushed to the gallery yet.

ITSNOTSTUPIDIFITWORKS commented 2 years ago

Oh i see. Thank you. Used the PSGallery version.