Created
January 12, 2013 16:57
-
-
Save tkmtmkt/4519239 to your computer and use it in GitHub Desktop.
Windowsの管理者権限の有無を判定する
This file contains 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
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