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

Status : 


Sign in
to vote
ID 846658 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 4/4/2014 1:26:03 PM
Access Restriction Public


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.
Sign in to post a comment.
Posted by Trevor Sullivan [MVP] 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

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:
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.