Menu & Search
Show Event Logs in PowerShell

Show Event Logs in PowerShell

This is a post on how to show event logs in PowerShell using Get-EventLog.

First up I’m showing a list of the types of event log available on my system.

Get-EventLog -List

We use the ‘Log’ output column above for the -LogName parameter in the command below. I’m bringing back the newest 1000 error events, grouping by event name and count of error occurrences.

Get-EventLog -LogName Application -Newest 1000 -EntryType Error | Group-Object -Property Source -NoElement | Sort-Object -Property Count -Descending

The above shows me the most frequent error event on my machine, the Apple Bonjour Service… Ah well, it’s fine.


Share

0 Comments