Skip to content

Instantly share code, notes, and snippets.

@dsolodow
Last active August 29, 2015 14:07
Show Gist options
  • Save dsolodow/6dfcfb3e413ae2fec5a2 to your computer and use it in GitHub Desktop.
Save dsolodow/6dfcfb3e413ae2fec5a2 to your computer and use it in GitHub Desktop.
sudo for PowerShell
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