Winget-cli: Issues when more than one package exist for winget install (ambigous names)

Created on 4 Jul 2020  路  12Comments  路  Source: microsoft/winget-cli

-->

ambigous software packages won't install is -v is specified. Here PowerShell 7.x

Steps to reproduce

open Powershell 5.1/ 7.x or Terminal
winget install Powershell
Output: 2 possible products tagged as powershell the correct install name would be Microsoft.Powershell and ...Powershell-Preview
Specifying the full ID give same list
Specifying -v 7.0.2
still will not install PowerShell 7.0.2 via winget but throws 2 possible packages still

Expected behavior

issueing
winget install powershell -v 7.0.2 should install PowerShell
winget install Microsoft.Powershell -v 7.0.2 should install PowerShell

same with preview tags, ID and version

Actual behavior

just outputs 2 versions are available no selection, installation possible.
image

Environment

[winget --info]
Windows Package Manager version: v1.0.41331.0
Windows: 20161.1000 and earlier
Package: : 1.0.41331.0


Resolution-Duplicate

Most helpful comment

@tommck are you asking me?

No, was mostly ranting in support of you :)

Turns out you have to use -e, like:

PS C:\dev> winget install -e Microsoft.PowerShell

All 12 comments

I now understand that -v / --version is to fetch and display the version of the tool winget.
I'd rather would use this to specify a version for installation (or later uninstall)

What exactly is one supposed to do here?

PS C:\dev> winget install Microsoft.Powershell
Multiple apps found matching input criteria. Please refine the input.
Name               Id                           Version
---------------------------------------------------------------
PowerShell-Preview Microsoft.PowerShell-Preview 7.1.0-preview.3
PowerShell         Microsoft.PowerShell         7.0.2

I see no way to pare this down to anymore

@tommck are you asking me?

@tommck are you asking me?

No, was mostly ranting in support of you :)

Turns out you have to use -e, like:

PS C:\dev> winget install -e Microsoft.PowerShell

as said -v is more logical to pick a version and -v is a duplicate of --info.
for --info there is no -i command

Team, you're going the same path as for Terminal lads remote related design question / issue
https://github.com/microsoft/terminal/issues/4632#issuecomment-618462070

@Karl-WE You seem to be new to command line programs. winget supports a number of subcommands (install, show, search, etc.). If you pass the -? to one of those you'll see the additional options for those subcommands. You would've also seen that had you checked the online documentation.

To install a version other than latest you use:

# winget install --exact <id> --version <version number>

winget install Microsoft.dotnet --version 3.1.301 --exact
Found .NET Core [Microsoft.dotnet]
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.visualstudio.microsoft.com/download/pr/4e88f517-196e-4b17-a40c-2692c689661d/eed3f5fca28262f764d8b650585a7278/dotnet-sdk-3.1.301-win-x64.exe
  鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅   124 MB /  124 MB
Successfully verified installer hash
Installing ...
Successfully installed!

@denelon This is a duplicate of #292

@megamorf I am not new to this megamorf.

winget --version will output the version of the tool
image

Given the logic that you can enter -? at any level reminds me much of Cisco IOS and speaking for Windows

  • fsutil
  • netsh
  • dism

but it is not overly very common in Windows to have the ability to specify /? any time with the previous level of commands. Some have it some have not.

Thanks for giving me the idea winget would favour this. Powershell does not offer a context sensitive help, quite unfortunately.

Before this dupe is entirely wasted time, please let us have a PR to make the winget ? more pointing out to this.

Still I see a inconsistency with the commandline options, we might discuss this in a new bug / feature request:

example

winget ? = help _(fallback)_
winget /? = help _(fallback)_
winget -? = help
winget --? = help

next level:
winget install ? or winget install /?
"no matching criteria"

winget install --? works
winget install -? works

Albeit help says:
Wenn Sie weitere Details zu einem bestimmten Befehl erfahren m枚chten, 眉bergeben Sie ihm das Hilfe-Argument. [-?]

I would rather see it here

Die folgenden Optionen stehen zur Verf眉gung:
-v,--version Version des Tools anzeigen
--info Allgemeine Informationen zum Tool anzeigen
-?, --? kontextsensitive Hilfe.
Wenn Sie weitere Details zu einem bestimmten Befehl erfahren m枚chten,
眉bergeben Sie ihm das Hilfe-Argument

Mind we are still on Windows, and -- commandlines are not common here. For a new tool like winget, which I see a bright future and major positive impact, we should not be dev-oriented but user oriented striving for consistency and clear and concise UX without reading docs, eventually with command lines everything should to work /? or ? see also, I refrain, microsoft/terminal#4632 (comment)
Otherwise winget is a Linux User friendly command line tool, but not so Windows user friendly.

IF we want to drop /? in favour for -? or --? or even ? I am absolutely ok with that

Then please leave a remark when winget /? is issued "please use -? or --? for help"

@Karl-WE the issue as posted looks like a duplicate of #292 as @megamorf commented. I think the issue as you've elaborated now looks more like a new request to either make aliases for other forms of "?" or to provide hints when one is used. I don't believe we have an Issue for that feature.

Duplicate of #292

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

Was this page helpful?
0 / 5 - 0 ratings