Created
March 24, 2019 07:56
-
-
Save tamuhey/84f783df960006da2b10cea0ee4dc690 to your computer and use it in GitHub Desktop.
Sudo for Powershell
This file contains 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 sudo() | |
{ | |
if ($args.Length -eq 1) | |
{ | |
start-process $args[0] -verb runAs | |
} | |
if ($args.Length -gt 1) | |
{ | |
start-process $args[0] -Args "-executionpolicy bypass -command Set-Location \`"$PWD\`"; $($args[1..$args.Length])" -verb runAs | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment