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
{{ message }}
Repository navigation
Winget doesn't work when run from elevated cmd #2443
Winget works fine from non-elevated cmd. From elevated cmd it gives "Failed when searching source; results will not be included: winget" error on almost every command
Expected behavior
Expected to be able to use winget on elevated prompt without the need to enter admin password to install software
Actual behavior
If I run exactly same command on elevated and non-elevated prompts I get different behaviours
Source update doesn't make any difference
Comment
I think I have read though all the solutions I could find, most of them point to the issue with PATH, but in my case I can run the software, but it doesn't work as expected. Please advise.
Activity
denelon commentedon Aug 11, 2022
Which version of winget is this?
The output from
winget --infohelps to troubleshoot.Does winget run in administrator mode from "C:\Users\Administrator>"?
Try running
winget source reset --forcein the administrator prompt.koniu80 commentedon Aug 12, 2022
Hi,
See below. No change
mark-eagles commentedon Oct 21, 2022
Getting same issue from Administrator command prompt on Win 10:
mark-eagles commentedon Oct 21, 2022
The following fixed this issue for me (running from admin powershell), I installed the Microsoft.Winget.Source app with the following:
Invoke-WebRequest 'https://cdn.winget.microsoft.com/cache/source.msix' -OutFile 'c:\downloads\Microsoft.Winget.Source.msix' -UseBasicParsing
Push-Location 'c:\downloads';
Add-AppxPackage -Path 'Microsoft.Winget.Source.msix';
Pop-Location;
Bognar commentedon Nov 27, 2022
I am having the same issue; I can run as local user but not as admin from cmd and PowerShell.
The invoke command from above did not help in my case.
xillibit commentedon Mar 9, 2023
For me it's fixed in 1.5.441-preview