+ PSv2 Compatibility

Fix for unable to index into object of type System.Diagnostic.Process on PSv2.
This commit is contained in:
b33f 2017-07-17 21:32:22 +01:00 committed by GitHub
parent b895866c3b
commit e47c52a090
1 changed files with 1 additions and 1 deletions

View File

@ -3346,7 +3346,7 @@ function Invoke-CredentialInjection
} }
elseif ($PsCmdlet.ParameterSetName -ieq "ExistingWinLogon") elseif ($PsCmdlet.ParameterSetName -ieq "ExistingWinLogon")
{ {
$WinLogonProcessId = (Get-Process -Name "winlogon")[0].Id $WinLogonProcessId = (Get-Process -Name "winlogon"| Select-Object -first 1).Id
} }
#Get a ushort representing the logontype #Get a ushort representing the logontype