Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winget doesn't work when run from elevated cmd #2443

Closed
koniu80 opened this issue Aug 11, 2022 · 6 comments
Closed

Winget doesn't work when run from elevated cmd #2443

koniu80 opened this issue Aug 11, 2022 · 6 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@koniu80
Copy link

koniu80 commented Aug 11, 2022

Brief description of your issue

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

image

image

Source update doesn't make any difference

image

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.

@ghost ghost added the Needs-Triage Issue need to be triaged label Aug 11, 2022
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Aug 11, 2022
@denelon
Copy link
Contributor

denelon commented Aug 11, 2022

Which version of winget is this?

The output from winget --info helps to troubleshoot.

Does winget run in administrator mode from "C:\Users\Administrator>"?

Try running winget source reset --force in the administrator prompt.

@denelon denelon added the Needs-Author-Feedback Issue needs attention from issue or PR author label Aug 11, 2022
@koniu80
Copy link
Author

koniu80 commented Aug 12, 2022

Hi,

See below. No change

image

@ghost ghost added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Aug 12, 2022
@mark-eagles
Copy link

Getting same issue from Administrator command prompt on Win 10:

image

@mark-eagles
Copy link

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
Copy link

Bognar commented 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.

@denelon denelon added this to the v1.5-Client milestone Feb 14, 2023
@xillibit
Copy link

xillibit commented Mar 9, 2023

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.

For me it's fixed in 1.5.441-preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

5 participants