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 ...
Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.