PowerShell Log File Viewer

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: