Dmitry Nefedov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
Sophia/PowerShell 5.1/Module/Sophia.psm1
|
@ -93,7 +93,7 @@ function Checkings |
|
|
# Check whether the logged-in user is an admin |
|
|
# Check whether the logged-in user is an admin |
|
|
$CurrentUserName = (Get-Process -Id $PID -IncludeUserName).UserName | Split-Path -Leaf |
|
|
$CurrentUserName = (Get-Process -Id $PID -IncludeUserName).UserName | Split-Path -Leaf |
|
|
$CurrentSessionId = (Get-Process -Id $PID -IncludeUserName).SessionId |
|
|
$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) |
|
|
switch ($CurrentUserName -eq $LoginUserName) |
|
|
{ |
|
|
{ |
|
|