From 00a1c046bf4c12467dd25fa835dd96d59e6a7d9d Mon Sep 17 00:00:00 2001 From: Thomas Nieto <38873752+ThomasNieto@users.noreply.github.com> Date: Sun, 16 Apr 2023 21:38:17 -0500 Subject: [PATCH] Fix version filter for packages without version (#14) --- src/private/Get-WinGetPackage.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/private/Get-WinGetPackage.ps1 b/src/private/Get-WinGetPackage.ps1 index d5d4296..8a5824c 100644 --- a/src/private/Get-WinGetPackage.ps1 +++ b/src/private/Get-WinGetPackage.ps1 @@ -9,5 +9,5 @@ function Get-WinGetPackage { # We apply additional package name filtering when using wildcards to make WinGet's wildcard behavior more PowerShell-esque Cobalt\Get-WinGetPackage | Where-Object {$Request.IsMatch($_.ID)} | - Where-Object {-Not $Request.Version -Or $Request.Version.Satisfies($_.Version)} + Where-Object {-Not $Request.Version -Or ($_.Version -And $Request.Version.Satisfies($_.Version))} }