Skip to content

Instantly share code, notes, and snippets.

@tamuhey
Created March 24, 2019 07:56
Show Gist options
  • Save tamuhey/84f783df960006da2b10cea0ee4dc690 to your computer and use it in GitHub Desktop.
Save tamuhey/84f783df960006da2b10cea0ee4dc690 to your computer and use it in GitHub Desktop.
Sudo for Powershell
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