If you have to find information in unstructured log files, PowerShell offers a variety of cmdlets that can help you parse text files to extract the information you need.
In my last article, I showed you how to search the Windows Event Log with Get-Event. That’s where you usually spot most of the pertinent messages. However, sometimes you also need to reference log files in textual format. For example, this is the case for the Windows Update log or the Firewall log.
Contents of this article:
- Displaying the content of a log file
- Displaying long log files
- Displaying only the end of a log file
- Displaying only specific lines
- Displaying only specific lines inside their context
- Opening a remote file