You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-DocsIt's a documentation issue that really should be on MicrosoftDocsIssue-FeatureThis is a feature request for the Windows Package Manager client.
I've read through a bunch of similar issues but either the suggestions don't work (any more) or when I do get winget.exe into the container it would just not do anything (winget.exe --version just exited with 0 instantly without any output, similar for any other command).
Feels like such an essential thing to be able to easily install winget.exe in various environments so this should really 1. "just work" and 2. have clear instructions for how to do it (docker is widely used so one example explicitly for this feels necessary).
The command winget --version should output the current version:
PS C:\ManVal> winget --version
v1.4.10173
What does winget --info provide?
This is within a Docker container -- which OS is it running? How is the WinGet application called - directly, in script, or another way? Is this in an interactive session with the container, or is it through automated operation?
Due to the way winget is installed via MSIX via the App Installer package, I see a couple of challenges. The first is depending on the Windows SKU, WinGet might not be registered. This generally happens a few minutes (15-ish) after the OS is logged into, the Microsoft Store will check for an upgrade, download it and then register it. It may be registered via PowerShell. The second is WinGet is not available in the System context.
The command winget --version should output the current version:
PS C:\ManVal> winget --version
v1.4.10173
I mean, yes... (:
What does winget --info provide?
Nothing.
This is within a Docker container -- which OS is it running? How is the WinGet application called - directly, in script, or another way? Is this in an interactive session with the container, or is it through automated operation?
These are the exact commands I run which do not work inside a container (docker run --rm -it <image>, winget.exe --version produces no output), but it does work locally all fine.
Run this in a fresh cmd.exe terminal (cd to some tempdir you've created):
In case this helps anyone, here's how to do this with Powershell, just be sure to open up a new terminal afterwards for it to be available in PATH.
This also extracts WindowsPackageManager.dll.
I can install winget in Server 2025 Container, and it returns a version, and even returns from an install, but the install does not work (no output, no installed tool), so what do we do with winget in a container when it doesn't work?
Issue-DocsIt's a documentation issue that really should be on MicrosoftDocsIssue-FeatureThis is a feature request for the Windows Package Manager client.
Activity
stephengillie commentedon Mar 3, 2023
Hi Fred Helmesjö (@helmesjo),
The command
winget --versionshould output the current version:What does
winget --infoprovide?This is within a Docker container -- which OS is it running? How is the WinGet application called - directly, in script, or another way? Is this in an interactive session with the container, or is it through automated operation?
denelon commentedon Mar 3, 2023
Due to the way winget is installed via MSIX via the App Installer package, I see a couple of challenges. The first is depending on the Windows SKU, WinGet might not be registered. This generally happens a few minutes (15-ish) after the OS is logged into, the Microsoft Store will check for an upgrade, download it and then register it. It may be registered via PowerShell. The second is WinGet is not available in the System context.
There are workarounds to both of these.
This may work, but is not officially supported:
helmesjo commentedon Mar 8, 2023
I mean, yes... (:
Nothing.
These are the exact commands I run which do not work inside a container (
docker run --rm -it <image>,winget.exe --versionproduces no output), but it does work locally all fine.Run this in a fresh cmd.exe terminal (cd to some tempdir you've created):
My current dockerfile is exactly this:
helmesjo commentedon Mar 26, 2023
Any update here?
helmesjo commentedon Mar 26, 2023
No, I can give that a try. What would be the reason? Just for the sake of it, or is it explicitly required?
jwillikers commentedon Jun 6, 2023
In case this helps anyone, here's how to do this with Powershell, just be sure to open up a new terminal afterwards for it to be available in
PATH.This also extracts
WindowsPackageManager.dll.Yiwei-Ding commentedon Jun 7, 2024
Thanks Jordan Williams (@jwillikers) and Levvie - she/her (@ItzLevvie) . VCRedist is also required in my case.
Here's my PowerShell:
jankapte commentedon Oct 8, 2025
I can install winget in Server 2025 Container, and it returns a version, and even returns from an install, but the install does not work (no output, no installed tool), so what do we do with winget in a container when it doesn't work?