Browse Source

Update Sophia.psm1

pull/217/head
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
33587f1630
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Sophia/PowerShell 5.1/Module/Sophia.psm1

4
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

Loading…
Cancel
Save