Skip to content

Instantly share code, notes, and snippets.

@chaosddp
Created January 5, 2018 09:24
Show Gist options
  • Save chaosddp/81f9fb4b5301c0f1df23ef54f39775ca to your computer and use it in GitHub Desktop.
Save chaosddp/81f9fb4b5301c0f1df23ef54f39775ca to your computer and use it in GitHub Desktop.
Check if running as Admin
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment