From 7708a2075668d678fb968acb92a4dbfba84d53eb Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 15 Jul 2017 10:17:33 +0200 Subject: [PATCH] add an additional variable This way the output should appear before the Read-Host command --- scripts/users/get-lockout-location.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/users/get-lockout-location.ps1 b/scripts/users/get-lockout-location.ps1 index bcd7e07..e0e30bf 100644 --- a/scripts/users/get-lockout-location.ps1 +++ b/scripts/users/get-lockout-location.ps1 @@ -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'