Open timconner opened 11 months ago
Have you tried using -MatchOption Equals
? The syntax of the powershell cmdlets is not quite the same as the winget cli
PS> Find-WinGetPackage -?
NAME
Find-WinGetPackage
SYNTAX
Find-WinGetPackage [[-Query] <string[]>] [-Tag <string>] [-Command <string>] [-Count <uint>] [-Id <string>] [-Name
<string>] [-Moniker <string>] [-Source <string>] [-MatchOption {Equals | EqualsCaseInsensitive |
StartsWithCaseInsensitive | ContainsCaseInsensitive}] [<CommonParameters>]
ALIASES
None
REMARKS
None
Have you tried using
-MatchOption Equals
? The syntax of the powershell cmdlets is not quite the same as the winget cli
That works!
I was going off the examples in this repo like this one: https://github.com/microsoft/winget-cli/blob/190b81298eec67c993f62cb3c05bd5d13cb7e8b9/src/PowerShell/Microsoft.WinGet.Client/Examples/Sample_FindPackage.ps1#L28
Maybe it changed to MatchOption recently? My main issue is resolved with the MatchOption flag being pointed out, but maybe there is a documentation issue here?
@ryfu-msft can you take a look at the example?
Brief description of your issue
When using the PowerShell module, the -Exact switch is missing / doesn't work. There is no tab completion for the switch and adding it to the command generates no errors or results.
Attempted to use multiple versions of the module and PowerShell hosts on multiple computers.
The equivalent command line commands work. (e.g.
winget search --id Microsoft.WindowsTerminal --exact
)Microsoft.WindowsTerminal is only for demonstration purposes, the same result is produced reagardless of the package Id used.
Steps to reproduce
Start pwsh.exe
Expected behavior
I would expect the latest version of the package with the exact case sensitive name of Microsoft.WindowsTerminal to be returned.
Actual behavior
No output or errors.
Environment