Skip to main content

Powershell: Get-Content - tail command on Windows

Love tail command on Linux? Try Get-Content with Powershell 3.0+.

Powershell Get-Content

Example: Keep reading the last 20 lines from C:\Windows\WindowsUpdate.log file

PS C:\> Get-Content C:\Windows\WindowsUpdate.log -Tail 20 -Wait
Read 20 last line from C:\Windows\WindowsUpdate.log file
Read 20 last line from C:\Windows\WindowsUpdate.log file

Count how many lines in a text file

PS C:\> (Get-Content C:\Windows\WindowsUpdate.log).Count

Popular posts from this blog

Google Credential Provider for Windows: Notes

Google Credential Provider for Windows® (GCPW) lets users sign in to Windows® devices with the Google Account they use for work. GCPW provides users with a single sign-on experience to Google services and all the security features available with their Google Account.

IBM Domino: Stop and Start Server

It is so easy to stop and start IBM Domino mail server [on your test bed]. quit : stop mail server restart server : stop, wait for 10 seconds, and [automatically] start mail server To start the Web server manually, run command load http at the console. load http To stop the Web server , run tell http quit at the console. tell http quit