Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save victorwoo/115a3b43d8c5f2bcb41f7518962c6391 to your computer and use it in GitHub Desktop.
Save victorwoo/115a3b43d8c5f2bcb41f7518962c6391 to your computer and use it in GitHub Desktop.
Gist-PowerShell 检测是否以管理员身份运行
([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