winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Winget should allow --id to be used multiple times

Open gamer191 opened this issue 6 months ago • 3 comments

Brief description of your issue

Running winget with multiple --id arguments (eg winget install --id yt-dlp.yt-dlp --id gyan.ffmpeg) fails with Argument provided more times than allowed: 'id'. However, if I only include --id once (winget install --id yt-dlp.yt-dlp gyan.ffmpeg) it will fail with No package found matching input criteria. As such, it is impossible to install multiple packages with winget when using the --id argument

Steps to reproduce

Run winget install --id yt-dlp.yt-dlp --id gyan.ffmpeg

Expected behavior

Both packages get installed

Actual behavior

Argument provided more times than allowed: 'id'

Environment

Windows Package Manager v1.10.390
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.4061
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.25.390.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

gamer191 avatar Jun 02 '25 08:06 gamer191

You can provide multiple "queries" without the ID param, and it should have the desired result that you want as:

winget install yt-dlp.yt-dlp gyan.ffmpeg

mdanish-kh avatar Jun 02 '25 09:06 mdanish-kh

You can provide multiple "queries" without the ID param, and it should have the desired result that you want as:

Thanks. I'd argue that this is still a bug though, given the --id parameter exists for a reason

gamer191 avatar Jun 02 '25 09:06 gamer191

@gamer191, The "--id" argument is used to specify that the is to be compared to the "ID" parameter. Having more than one of those would be problematic. If you're looking to install a collection of packages, I'd suggest using winget export <json output file> and winget import <json input file>, or a WinGet Configuration file.

denelon avatar Jun 02 '25 14:06 denelon

Related: #1855

I more or less asked for the same functionality toward the end but didn't get a conclusive response. Should've probably created an issue instead.

github-account1111 avatar Jun 22 '25 08:06 github-account1111

Related: #5553

Asked the same

JasonCraneAdkins avatar Aug 30 '25 13:08 JasonCraneAdkins