Skip to content

Instantly share code, notes, and snippets.

@tkmtmkt
Created January 12, 2013 16:57
Show Gist options
  • Save tkmtmkt/4519239 to your computer and use it in GitHub Desktop.
Save tkmtmkt/4519239 to your computer and use it in GitHub Desktop.
Windowsの管理者権限の有無を判定する
function IsAdministrator {
[Security.Principal.WindowsPrincipal]$id = [Security.Principal.WindowsIdentity]::GetCurrent()
$id.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment