Just a quick post today with a great tip for viewing log files with Powershell.
Get-Content .\alltheerrors.log -wait
This command shows the content of the file line by line, and the
-wait switch updates the output whenever the log file is saved, giving you a live feed of logged info.
How cool is that!
For large log files, you probably don’t want to load the entire file, so you can use the
-tail switch to limit the initial output to a specified number of lines.
Get-Content .\alltheerrors.log -wait -tail 20