Skip to content

Instantly share code, notes, and snippets.

@cat5inthecradle
Last active September 24, 2015 13:41
Show Gist options
  • Select an option

  • Save cat5inthecradle/b8feebf2abc58aa888b5 to your computer and use it in GitHub Desktop.

Select an option

Save cat5inthecradle/b8feebf2abc58aa888b5 to your computer and use it in GitHub Desktop.
# Ok, so this is cheating and actually checks for the most
# recent time the Event Log service started, but 99% of
# the time this'll do.
$xml=@'
<QueryList>
<Query Id="0" Path="System">
<Select Path="System">*[System[(EventID=6005)]]</Select>
</Query>
</QueryList>
'@
Get-WinEvent -FilterXml $xml -MaxEvents 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment