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
It's ugly when you install a package using the command line and after that, a window prompt appears for a mouse click. Instead of this, something like sudo which ask for password before downloading the package will be beautiful and look consistent.
Yeah, you're right we can open the terminal as an administrator but when you working only on CLI it breaks the flow. It doesn't feel nice that you opened another terminal window just for installing a program.
Reacted by JoBrad, Simon Chan, Staffan Forsell, Alan-Liang, Joël R. Langlois, Poopooracoocoo, Jared Irwin, Luke Ordelmans, Bas van den Wollenberg, Doug Bailey and 11 more
But the only problem is that the command input is larger compared to just 'sudo winget install package', using runas you would have to do: 'runas /user:\administrator winget install package' (haven't tested that yet)
Yeah, you're right we can open the terminal as an administrator but when you working only on CLI it breaks the flow. It doesn't feel nice that you opened another terminal window just for installing a program.
Reacted by JoBrad, Joël R. Langlois, Martin Planer, James, Lari Liuhamo and Tim Brooks
But the only problem is that the command input is larger compared to just 'sudo winget install package', using runas you would have to do: 'runas /user:\administrator winget install package' (haven't tested that yet)
This can do the work if implemented with windows 10 and winget. Never thought MSFT already had something similar to sudo.
Opening a separate elevated prompt not only breaks the user workflow, but also introduces other follow-up steps, too. The user potentially needs to refresh the environment in the other terminal instance, or even destroy it and start over, depending on the updates made.
For some reason I am getting UAC prompts despite doing this. Any ideas?
Edit: Nevermind, fixed it. Some weird issue with SmartScreen.
I'm having the same issue, how did you fix it?
iirc all I did was change the local group policy via gpedit.msc: Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Windows Defender SmartScreen -> Explorer -> Configure Windows Defender SmartScreen
Activity
HeinVG commentedon May 21, 2020
In Windows, the closest thing to 'sudo' is Runas: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771525(v=ws.11)
But the only problem is that the command input is larger compared to just 'sudo winget install package', using runas you would have to do: 'runas /user:\administrator winget install package' (haven't tested that yet)
byteduck commentedon May 21, 2020
Could winget elevate itself and then install the packages?
dmex commentedon May 21, 2020
You can run the winget command from an elevated command prompt and won't see any UAC prompts when installing packages.
jessehouwing commentedon May 21, 2020
start the command prompt elevated using:
suhailmalik07 commentedon May 21, 2020
Yeah, you're right we can open the terminal
as an administratorbut when you working only on CLI it breaks the flow. It doesn't feel nice that you opened another terminal window just for installing a program.suhailmalik07 commentedon May 21, 2020
This can do the work if implemented with windows 10 and winget. Never thought MSFT already had something similar to
sudo.dhenze-dwz commentedon May 23, 2020
For some reason I am getting UAC prompts despite doing this. Any ideas?
Edit: Nevermind, fixed it. Some weird issue with SmartScreen.
JoBrad commentedon May 24, 2020
Opening a separate elevated prompt not only breaks the user workflow, but also introduces other follow-up steps, too. The user potentially needs to refresh the environment in the other terminal instance, or even destroy it and start over, depending on the updates made.
madrian-es commentedon May 28, 2020
I'm having the same issue, how did you fix it?
dhenze-dwz commentedon May 28, 2020
iirc all I did was change the local group policy via gpedit.msc:
Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Windows Defender SmartScreen -> Explorer -> Configure Windows Defender SmartScreenEither enable and set to warn, or disable.
ofersadan85 commentedon Oct 14, 2021
I solved it for myself through winget itself using
gsudo:When it is run from a normal (non admin) user, it will only ask for privileges escalation once (similar to how a normal
sudowould work)masterflitzer commentedon May 13, 2022
gsudo is amazing, it even comes with an sudo alias so you can do
sudo winget upgrade --alldenelon commentedon Dec 17, 2024
I've been going through the backlog checking on older issues. This one seems to be resolved with the release of sudo on Windows.