microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.08k stars 1.44k forks source link

Feature request: install multiple applications/interactive choice for multiple results #419

Open joelnedev opened 4 years ago

joelnedev commented 4 years ago

Description of the new feature/enhancement

I had some issues installing Terminal today, I told it to install terminal, "Windows Terminal", and Microsoft.WindowsTerminal, but it kept saying "multiple items matched your query." and exited. If it had said something like "Multiple items matched your query, enter 1 for Windows Terminal and 2 for Windows Terminal Preview" it would make it a lot more user friendly and reduces the time and effort required to install what you wanted.

Also, I was using powershell at the time only because I realised I hadn't installed terminal. if there was a way to install multiple packages, like "winget install 7zip terminal" similar to how apt install works, it would also further increase the time and effort taken to complete the task.

Proposed technical implementation details (optional)

For interactive choice of which package to install:

Multiple apps found matching input criteria. Please input the desired package:
    Name                                   Id                                                       Version
    ---------------------------------------------------------------------------------
[1] Windows Terminal              Microsoft.WindowsTerminal              1.0.1401.0
[2] Windows Terminal Preview Microsoft.WindowsTerminalPreview 1.0.1401.0
>1
Found Windows Terminal [Microsoft.WindowsTerminal]
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://github.com/microsoft/terminal/releases/download/v1.0.1401.0/Microsoft.WindowsTerminal_1.0.1401.0_8wekyb3d8bbwe.msixbundle
  ██████████████████████████████  18.1 MB / 18.1 MB
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed.

And as for installing multiple packages:

PS C:\Users\User1> winget install --multiple --exact "windows terminal" "windows terminal preview"
Found Windows Terminal [Microsoft.WindowsTerminal]
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://github.com/microsoft/terminal/releases/download/v1.0.1401.0/Microsoft.WindowsTerminal_1.0.1401.0_8wekyb3d8bbwe.msixbundle
  ██████████████████████████████  18.1 MB / 18.1 MB
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed.
Found Windows Terminal Preview [Microsoft.WindowsTerminalPreview]
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://github.com/microsoft/terminal/releases/download/v0.11.1191.0/Microsoft.WindowsTerminal_0.11.1191.0_8wekyb3d8bbwe.msixbundle
  ██████████████████████████████  16.5 MB / 16.5 MB
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed.

Thank you for considering my requests.

megamorf commented 4 years ago

Hey @JuhJuhButts, thanks for taking the time to report this. It's a known user experience issue so please use the --exact (-e) switch to make winget treat the search string as literal instead of attempting a substring match.

Since there are already open issues for this problem yours can be considered a duplicate, so please close it and subscribe to the following issues instead:

Edit: Oh and there's a RFC draft for those issues as well: #292 - winget should install an app if there is an exact match.md

For installing multiple applications with one winget call there are:

denelon commented 1 year ago

Hey all, we've implemented:

And the interactive ask isn't completed yet:

WinGet does have an "Interactive" setting for eliminating prompts for scripted execution: https://github.com/microsoft/winget-cli/blob/428ffb50527fbb20e39443e13cae2cfa7ec6cdcc/schemas/JSON/settings/settings.schema.0.2.json#L172-L182