Created
August 13, 2016 03:39
-
-
Save Dan1el42/51f0f0fdeb3f40f33ef8394c47aea219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Events = Get-WinEvent -LogName Security -MaxEvents 10 | |
foreach ($Event in $Events) { | |
$MessageLineArray = $Event.Message -split "`r`n" | |
if ($MessageLineArray.Count -ge 1) { | |
$MessageLineArray[0] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment