Added helper function to test for administrative shell

This commit is contained in:
Lord Hepipud 2019-10-07 00:06:15 +02:00
parent c509143433
commit bfc1a973b2

View file

@ -0,0 +1,11 @@
function Test-AdministrativeShell()
{
$WindowsPrincipcal = New-Object System.Security.Principal.WindowsPrincipal(
[System.Security.Principal.WindowsIdentity]::GetCurrent()
);
if ($WindowsPrincipcal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
return $TRUE;
}
return $FALSE;
}