microsoft / microsoft/winget-cli
`-Version` and `-IncludePrerelease` are mutually exclusive when they shouldn't be
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 attempting to use Repair-WinGetPackageManager I wanted to install a specific pre-release version. I included both the -Version and -IncludePrerelease options, which caused it to fail.
Steps to reproduce
PS C:\Windows\system32> Repair-WinGetPackageManager -Version 1.12.100 -IncludePrerelease
Repair-WinGetPackageManager : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Repair-WinGetPackageManager -Version 1.12.100 -IncludePrerelease
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Repair-WinGetPackageManager], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.WinGet.Client.Commands.RepairWinGetPackageManagerCmdlet
PS C:\Windows\system32> Repair-WinGetPackageManager -Version 1.12.100-preview -IncludePrerelease
Repair-WinGetPackageManager : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Repair-WinGetPackageManager -Version 1.12.100-preview -IncludePrerele ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Repair-WinGetPackageManager], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.WinGet.Client.Commands.RepairWinGetPackageManagerCmdlet
PS C:\Windows\system32> Repair-WinGetPackageManager -Version v1.12.100-preview -IncludePrerelease
Repair-WinGetPackageManager : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Repair-WinGetPackageManager -Version v1.12.100-preview -IncludePrerel ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Repair-WinGetPackageManager], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.WinGet.Client.Commands.RepairWinGetPackageManagerCmd
Expected behavior
I expected that -
- If I specified only
-Versionthe pre-release version would not be found - If I specified both
-Versionand-IncludePrereleasethe version would be found
Actual behavior
If I specify just -Version the pre-release version is found
If I specify both -Version and -IncludePrerelease the command throws an error that the parameter set is ambiguous
Environment
Name Version Source Summary
---- ------- ------ -------
Microsoft.WinGet.Client 1.11.440 PSGallery PowerShell Module for the Windows Package Manager Client.
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 at the Repair-WinGetPackageManager command and reproduce the parameter-binding error with -Version and -IncludePrerelease using the reported examples. Trace how those parameters are assigned to parameter sets, then verify that a specific prerelease version is rejected without -IncludePrerelease and accepted when both options are supplied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100