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

Find-WinGetPackage always results in $? being true #4861

Open
Trenly opened this issue Oct 10, 2024 · 0 comments
Open

Find-WinGetPackage always results in $? being true #4861

Trenly opened this issue Oct 10, 2024 · 0 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. PowerShell Issue related to WinGet PowerShell Module or cmdlet

Comments

@Trenly
Copy link
Contributor

Trenly commented Oct 10, 2024

Brief description of your issue

When using Find-WinGetPackage, even when no packages are found, the result of $? will always be True

Steps to reproduce

Find-WinGetPackage -Id asdfasdfadsf; $?

Expected behavior

If one or more packages is found, $? should be true. If no packages are found $? should be false.
This should match the behavior of winget search where winget search Google.Chrome; $? returns true but winget search asdfasdfasdfad; $? returns false

Actual behavior

$? always returns true after Find-WinGetPackage

Environment

PS E:\winget-pkgs> winget --info
Windows Package Manager (Preview) v1.9.2411-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.4317
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.2411.0

PS E:\winget-pkgs> Get-Module -ListAvailable -Name Microsoft.WinGet.Client

    Directory: C:\Users\Trenly\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     1.9.2411              Microsoft.WinGet.Client             Core,Desk {Get-WinGetVersion, Find-WinGetPackage, Get-WinGetPackage, Get-WinGetSource…}
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Oct 10, 2024
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. PowerShell Issue related to WinGet PowerShell Module or cmdlet and removed Needs-Triage Issue need to be triaged labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. PowerShell Issue related to WinGet PowerShell Module or cmdlet
Projects
None yet
Development

No branches or pull requests

2 participants