Skip to content

Instantly share code, notes, and snippets.

@arebee
Created April 29, 2014 19:52
Show Gist options
  • Save arebee/d5cdca802e0961b547c5 to your computer and use it in GitHub Desktop.
Save arebee/d5cdca802e0961b547c5 to your computer and use it in GitHub Desktop.
Powershell one-liner for UAC detection.
# Will return false if you aren't in a UAC evelvated command prompt. true if you are.
(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment