Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell module commands missing Exact switch #3809

Open
timconner opened this issue Oct 25, 2023 · 3 comments
Open

PowerShell module commands missing Exact switch #3809

timconner opened this issue Oct 25, 2023 · 3 comments
Assignees
Labels
Issue-Docs It's a documentation issue that really should be on MicrosoftDocs

Comments

@timconner
Copy link

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

Install-Module -Name Microsoft.WinGet.Client
Find-WinGetPackage -Id Microsoft.WindowsTerminal -Exact

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

OS: Windows 10 22H2 (Enterprise)

PowerShell Hosts:
PowerShell 7.3.8 (x64)
PowerShell 7.2.6 (x64)

Microsoft.WinGet.Client Module Versions:
0.2.2
0.2.1
0.2.0
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Oct 25, 2023
@Trenly
Copy link
Contributor

Trenly commented Oct 25, 2023

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

@timconner
Copy link
Author

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:

Find-WinGetPackage -Id Git.Git -Source winget -Exact

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?

@denelon
Copy link
Contributor

denelon commented Oct 25, 2023

@ryfu-msft can you take a look at the example?

@denelon denelon added Issue-Docs It's a documentation issue that really should be on MicrosoftDocs and removed Needs-Triage Issue need to be triaged labels Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Docs It's a documentation issue that really should be on MicrosoftDocs
Projects
None yet
Development

No branches or pull requests

4 participants