From b0bd2041825943a8c73c66cb9e1ddd8992e787a5 Mon Sep 17 00:00:00 2001 From: mdaneri Date: Fri, 22 Nov 2024 06:30:30 -0800 Subject: [PATCH] Update Helpers.ps1 --- src/Private/Helpers.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Private/Helpers.ps1 b/src/Private/Helpers.ps1 index e4093f281..f14997a4e 100644 --- a/src/Private/Helpers.ps1 +++ b/src/Private/Helpers.ps1 @@ -3807,7 +3807,7 @@ function Test-PodeAdminPrivilege { # Retrieve the current Windows identity and token $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = [Security.Principal.WindowsPrincipal]::new($identity) - + if ($null -eq $principal) { return $false } @@ -3818,7 +3818,7 @@ function Test-PodeAdminPrivilege { } # Check if the token is elevated - if ($identity.IsSystem || $identity.IsAuthenticated -and $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + if ($identity.IsSystem -or $identity.IsAuthenticated -and $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { return $true }