Created
December 14, 2011 14:36
-
-
Save agileguy/1476823 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
| $file, [string]$arguments = $args; | |
| if([System.IO.File]::Exists("$(get-location)\$file")) | |
| { | |
| $file = "$(Get-Location)\$file"; | |
| } | |
| $psi = new-object System.Diagnostics.ProcessStartInfo $file; | |
| $psi.Arguments = $arguments; | |
| $psi.Verb = "runas"; | |
| [System.Diagnostics.Process]::Start($psi); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment