Created
July 10, 2017 01:56
-
-
Save ctrl-freak/12d55bb6c6db1b4f8f68ec438086b65f to your computer and use it in GitHub Desktop.
Elevate 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
# Ask for elevated permissions if required | |
# https://github.com/Scine/Powershell/blob/master/ReclaimWindows10.ps1 | |
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs | |
Exit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment