Skip to content

Instantly share code, notes, and snippets.

@tahir-hassan
Created November 29, 2019 17:19
Show Gist options
  • Save tahir-hassan/f2ec4645625197f945ee3f4efdffd681 to your computer and use it in GitHub Desktop.
Save tahir-hassan/f2ec4645625197f945ee3f4efdffd681 to your computer and use it in GitHub Desktop.
PowerShell script, when invoked, will open a new elevated window. The idea is to keep this script in a directory to the PATH environment variable.
param()
$ErrorActionPreference = 'Stop';
Start-Process -Verb runAs -ArgumentList '-NoExit','cd',(Get-Item .).FullName powershell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment