Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dan1el42/51f0f0fdeb3f40f33ef8394c47aea219 to your computer and use it in GitHub Desktop.
Save Dan1el42/51f0f0fdeb3f40f33ef8394c47aea219 to your computer and use it in GitHub Desktop.
$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