PowerShell

Get-WinEvent

SafeQuery event logs (modern)

Get-WinEvent -LogName System -MaxEvents 50

Successor to Get-EventLog, covers modern logs. FilterHashtable filtering is dramatically faster.

Examples

  • Get-WinEvent -FilterHashtable @{LogName='System';Id=6008} -MaxEvents 10Unexpected shutdown events

Syntax

Get-WinEvent [-LogName name] [-FilterHashtable @{...}]

Before you run it

Read only.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store