Created
February 26, 2015 20:24
-
-
Save rgunst/e682be4774c15ed1d97c to your computer and use it in GitHub Desktop.
sudo for powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function elevate-process | |
{ | |
$file, [string]$arguments = $args; | |
$psi = new-object System.Diagnostics.ProcessStartInfo $file; | |
$psi.Arguments = $arguments; | |
$psi.Verb = "runas"; | |
$psi.WorkingDirectory = get-location; | |
[System.Diagnostics.Process]::Start($psi); | |
} | |
set-alias sudo elevate-process; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment