Testing if current PowerShell session is elevated

By | June 2, 2013

(([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] “Administrator”))

Leave a Reply

Your email address will not be published. Required fields are marked *