Skip to content

Instantly share code, notes, and snippets.

@NateScarlet
Last active February 21, 2019 14:20
Show Gist options
  • Save NateScarlet/8acfafcbcdd97603fea6794964d155d8 to your computer and use it in GitHub Desktop.
Save NateScarlet/8acfafcbcdd97603fea6794964d155d8 to your computer and use it in GitHub Desktop.
Sudo for windows
CALL :SUDO %*
GOTO :EOF
:SUDO
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "Start-Process -Wait -FilePath powershell.exe -ArgumentList @('-NoProfile', '-InputFormat', 'None', '-ExecutionPolicy', 'Bypass', '-Command', 'cd', '%cd%', ';', """%*""") -verb RunAs"
GOTO :EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment