From 33587f1630d4370607f0a985a27de3ff30ff02ec Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 13 Jul 2021 15:22:19 +0300 Subject: [PATCH] Update Sophia.psm1 --- Sophia/PowerShell 5.1/Module/Sophia.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sophia/PowerShell 5.1/Module/Sophia.psm1 b/Sophia/PowerShell 5.1/Module/Sophia.psm1 index 17974ff5..dd60eb86 100644 --- a/Sophia/PowerShell 5.1/Module/Sophia.psm1 +++ b/Sophia/PowerShell 5.1/Module/Sophia.psm1 @@ -95,9 +95,9 @@ function Checkings $CurrentSessionId = (Get-Process -Id $PID -IncludeUserName).SessionId $LoginUserName = (Get-Process -IncludeUserName -ErrorAction SilentlyContinue | Where-Object -FilterScript {($_.Name -eq "explorer") -and ($_.SessionId -eq $CurrentSessionId)}).UserName | Select-Object -Index 1 | Split-Path -Leaf - switch ($CurrentUserName -eq $LoginUserName) + switch ($CurrentUserName -ne $LoginUserName) { - $false + $true { Write-Warning -Message $Localization.LoggedInUserNotAdmin exit