Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created April 2, 2016 17:03
Show Gist options
  • Select an option

  • Save kapb14/a48a1babf99b19500d15e02ff5a25187 to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/a48a1babf99b19500d15e02ff5a25187 to your computer and use it in GitHub Desktop.
Install 'sudo.cmd' script with Powershell
<#
.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