Get-WinEvent
noun
say it: “GET WIN ee-VENT” /ˈɡɛt ˈwɪn ɪˈvɛnt/
A PowerShell command that reads Windows' event logs, the records Windows keeps of what happened on the PC and when.
What does Get-WinEvent do?
Get-WinEvent reads Windows' event logs, the diary Windows keeps of what happens on the PC. -FilterHashtable hands the log a list of what you want, such as the System log's restart events, so it sends back only those; -MaxEvents keeps the newest few.
Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 41, 1074, 6005, 6006, 6008 } -MaxEvents 6
In a sentence
- “With -FilterHashtable, Get-WinEvent answered in a moment instead of four seconds.”
- “Get-WinEvent showed 1074, 6006 and 6005: a planned restart, not a crash.”
Level: Journeyman · More PowerShell terms at this level
Updated