Perusing General Log Files
If you are only interested in glancing at the event logs for an overview of the types of errors, you can use the Get-EventLog cmdlet. This is shown in the GetNewestLogEntries.ps1 script. This script relies upon using the -newest argument to retrieve only a specific number of event log entries.
Tip
When passing more than one argument to a cmdlet, I prefer to specify the name of all parameters. Technically, you can use the default parameter without using its parameter name, but then you still must specify the optional parameters. It can become confusing, so I just do the following: type a hyphen, press Tab, press Enter, type another hyphen, and press Tab once again and I am finished. This does not require much more time ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access