Created
April 2, 2016 17:03
-
-
Save kapb14/a48a1babf99b19500d15e02ff5a25187 to your computer and use it in GitHub Desktop.
Install 'sudo.cmd' script with 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
| <# | |
| .SYNOPSIS | |
| Simple and dirty "hack" to have a "sudo" on Windows. Downloads script and places it into "C:\Windows\System32\". | |
| .EXAMPLE | |
| sudo powershell | |
| .EXAMPLE | |
| sudo notepad C:\Windows\System32\drivers\etc\hosts | |
| .LINKS | |
| https://gist.githubusercontent.com/kapb14/73121937ad36a50de271/raw/e75a44132fb024835a12a79bd9dc4181936bb325/sudo.cmd | |
| #> | |
| $sudoCmd = "sudo.cmd" | |
| $sudoFile = "C:\Windows\System32\" + $sudoCmd | |
| $url = "https://gist.githubusercontent.com/kapb14/73121937ad36a50de271/raw/e75a44132fb024835a12a79bd9dc4181936bb325/sudo.cmd" | |
| Invoke-WebRequest -Uri $url -OutFile $sudoFile -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment