Last active
August 29, 2015 14:07
-
-
Save dsolodow/6dfcfb3e413ae2fec5a2 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 Start-Elevated { | |
[CmdletBinding()] | |
Param ( | |
[parameter(Mandatory = $true,ValueFromPipeline=$true,Position=0)] [String]$FilePath, | |
[parameter(Mandatory = $false,ValueFromRemainingArguments=$true,Position=1)] [String[]]$ArgumentList | |
) | |
Start-Process -verb RunAs @PSBoundParameters | |
} | |
New-Alias -Name 'sudo' -Value 'Start-Elevated' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment