The problem in #30 was when only 1 package was returned (i.e. only Chocolatey is installed on the system).
The $UnfilteredResult would be a PSObject, and not a collection. Replacing with | Where-Object did the trick.
Took the opportunity to change the logic of the cache, to something that's a bit more clear and that makes sense now... :)
The problem in #30 was when only 1 package was returned (i.e. only Chocolatey is installed on the system). The
$UnfilteredResult
would be a PSObject, and not a collection. Replacing with| Where-Object
did the trick.Took the opportunity to change the logic of the cache, to something that's a bit more clear and that makes sense now... :)