Internal/_IsSessionElevated.ps1
function _IsSessionElevated { $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity) return $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) } |