Powershell Tip #16: Unix tail equivalent command (to monitor a file)

By | August 4, 2015

Tip: You can monitor the latest changes of a file (example: a log file with the latest logons).

Get-Content -Path 'C:\ProgramData\chocolatey\logs\chocolatey.log' -Tail 10 -Wait

-Tail 10 : to display the latest 10 lines of the file

-Wait : to see the updates in real time

get-content-tail-wait


previous-buttonnext-button

2 thoughts on “Powershell Tip #16: Unix tail equivalent command (to monitor a file)

  1. Pingback: Powershell Tip #15: Use a BrowseFolder dialog for user input | Powershell Guru

  2. michel dsouza

    -wait command fail to display the updated content in real time.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *