Home Dashboard Directory Help
Search

The last thing PowerShell needs to have full parity with BASH is a Sudo Equivalent by Stephen Owen


Status: 

Active


20
0
Sign in
to vote
Type: Suggestion
ID: 846658
Opened: 4/4/2014 1:26:03 PM
Access Restriction: Public
0
Workaround(s)
view

Description

Hi all,

With this awesome new addition of official Chocolatey (I cannot spell this word) support, we at The Scripting Guys group on FB realized that the only thing missing to have full feature parity with BASH is Sudo!

Sudo has become equivalent with nerdy coolness and now that PowerShell is growing in support and fandom at such a pace, we need our own Sudo, in order to temporarily run commands as super-user without launching PowerShell as an admin.

Give us sudo, and make sure that it has a cool name. I'd recommend 'PowerUp' or something similar, to keep the coolness levels up.
Details
Sign in to post a comment.
Posted by Trevor Sullivan on 5/5/2014 at 5:27 AM
Since the Windows architecture uses UAC as a security boundary, how about having an -AsAdmin parameter for the Start-Process cmdlet?

1. Start-Process -FilePath c:\notepad.exe -AsAdmin;
2. [ALT] + Y (to say "Yes" to UAC prompt)
3. Program running as admin

Cheers,
Trevor Sullivan
Microsoft PowerShell MVP
Posted by rfoust on 4/13/2014 at 6:12 PM
Bill: Regarding your comment about "everyone is an admin", how is that any different than everyone doing a right-click -> RunAs Administrator? At least this would push granularity down to the prompt and not the entire session. (I haven't read the blog post you linked to yet, I'll go there now) :-)
Posted by Bill_Stewart on 4/7/2014 at 11:53 AM
sudo isn't a bash feature but rather a **ix tool/command. In the same way a sudo-like feature wouldn't be part of PowerShell but rather a part of the OS core. For this reason this is not likely something to be added to PowerShell for the reasons explained here: http://blogs.msdn.com/b/aaron_margosis/archive/2007/06/29/faq-why-can-t-i-bypass-the-uac-prompt.aspx
Basically if sudo were available on Windows, we would never get away from "everyone is an admin" because everyone would simply run everything as admin, which defeats the purpose of trying to get people to stop doing exactly that.
Sign in to post a workaround.