microsoft / microsoft/winget-cli
Find-WinGetPackage always results in $? being true
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
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…}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Find-WinGetPackage entry point and reproduce the command shown in the issue, comparing its PowerShell success status with winget search. Trace how no-result searches are reported, then verify that the command returns true when a package is found and false when none is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100