From 99f40041576fddd863bc515a4912768b1229155f Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 13 Jul 2021 15:20:01 +0300 Subject: [PATCH] Update Sophia.psm1 --- Sophia/PowerShell 5.1/Module/Sophia.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sophia/PowerShell 5.1/Module/Sophia.psm1 b/Sophia/PowerShell 5.1/Module/Sophia.psm1 index dff7a374..17974ff5 100644 --- a/Sophia/PowerShell 5.1/Module/Sophia.psm1 +++ b/Sophia/PowerShell 5.1/Module/Sophia.psm1 @@ -93,7 +93,7 @@ function Checkings # Check whether the logged-in user is an admin $CurrentUserName = (Get-Process -Id $PID -IncludeUserName).UserName | Split-Path -Leaf $CurrentSessionId = (Get-Process -Id $PID -IncludeUserName).SessionId - $LoginUserName = (Get-Process -IncludeUserName -ErrorAction SilentlyContinue | Where-Object -FilterScript {($_.Name -eq "explorer") -and ($_.SessionId -eq $CurrentSessionId)}).UserName | Split-Path -Leaf + $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) {