Enable a command to run as Administrator #9840

Closed
opened 2026-01-31 02:05:17 +00:00 by claunia · 5 comments
Owner

Originally created by @okantmav on GitHub (Jul 25, 2020).

Enable a solution into the terminal to run it from an elevated command shell (cmd/powershell).

I forget to run the terminal as admin, I think many people do it.

Proposed technical implementation details

It could great to use hot key to select "user " or "admin" shell.

{ "command": "RunAsAdmin", "keys": "ctrl+shift+a" }

The issue of forget to run the terminal as "admin":

"You may experience errors - many functions/packages require admin rights. Only advanced users should run choco w/out an
elevated shell. When you open the command shell, you should ensure hat you do so with "Run as Administrator" selected. If you are attempting to use Chocolatey in a non-administrator setting, you must select a different location other than the default install location."

This message is frequent, so I should to close the terminal and open it again as "admin".

Originally created by @okantmav on GitHub (Jul 25, 2020). # Enable a solution into the terminal to run it from an **elevated command shell** (cmd/powershell). ### I forget to run the terminal as admin, I think many people do it. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details It could great to use hot key to select "user " or "admin" shell. `{ "command": "RunAsAdmin", "keys": "ctrl+shift+a" }` <!-- A clear and concise description of what you want to happen. --> The issue of forget to run the terminal as "admin": "You may experience errors - many functions/packages require admin rights. Only advanced users should run choco w/out an elevated shell. When you open the command shell, you should ensure hat you do so with "Run as Administrator" selected. If you are attempting to use Chocolatey in a non-administrator setting, you must select a different location other than the default install location." This message is frequent, so I should to close the terminal and open it again as "admin".
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 02:05:17 +00:00
Author
Owner

@dafzor commented on GitHub (Jul 26, 2020):

See issue #146. In the meantime you have a great solution with gsudo.

Personally I've set up my powershell profile to override all chocolatey alias with:

function choco { gsudo choco @args }
@dafzor commented on GitHub (Jul 26, 2020): See issue #146. In the meantime you have a great solution with [gsudo](https://github.com/gerardog/gsudo). Personally I've set up my powershell profile to override all chocolatey alias with: ```powershell function choco { gsudo choco @args } ```
Author
Owner

@skyline75489 commented on GitHub (Jul 27, 2020):

I’m so happy to learn that there’s gsudo. It feels super elegant to me. I’m a little surprised that no one mentions gsudo in #146.

@skyline75489 commented on GitHub (Jul 27, 2020): I’m so happy to learn that there’s gsudo. It feels super elegant to me. I’m a little surprised that no one mentions gsudo in #146.
Author
Owner

@dafzor commented on GitHub (Jul 27, 2020):

The allow elevation issue and it's variants keeps getting duplicate reports. So there's nuggets of information spread all over the place (I learned about gsudo on one of them)

@dafzor commented on GitHub (Jul 27, 2020): The allow elevation issue and it's variants keeps getting duplicate reports. So there's nuggets of information spread all over the place (I learned about gsudo on one of them)
Author
Owner

@zadjii-msft commented on GitHub (Jul 27, 2020):

There's also #632/#1032/#5000 tracking the mixed elevation of tabs, so I'm gonna close this as a collective dupe of all those threads.

/dup #146 #632 #1032 #5000

@zadjii-msft commented on GitHub (Jul 27, 2020): There's also #632/#1032/#5000 tracking the mixed elevation of tabs, so I'm gonna close this as a collective dupe of all those threads. /dup #146 #632 #1032 #5000
Author
Owner

@ghost commented on GitHub (Jul 27, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jul 27, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9840