add an additional variable

This way the output should appear before the Read-Host command
This commit is contained in:
Andreas Zweili 2017-07-15 10:17:33 +02:00
parent 894b32da60
commit 7708a20756
1 changed files with 3 additions and 1 deletions

View File

@ -124,7 +124,7 @@ Function Get-LockedOutLocation
Write-Warning $_
Continue
}#end catch
Foreach($Event in $LockedOutEvents)
$Events = Foreach($Event in $LockedOutEvents)
{
If($Event | Where {$_.Properties[2].value -match $UserInfo.SID.Value})
{
@ -145,6 +145,7 @@ Function Get-LockedOutLocation
}#end ifevent
}#end foreach lockedout event
$Events | Format-List
}#end process
@ -152,3 +153,4 @@ Function Get-LockedOutLocation
$username = Read-Host 'Please enter a username'
Get-LockedOutLocation -Identity $username
Read-Host 'Press a key to quit'