[PowerShell] Monitor active log files in Windows using type -wait command

Oh this is super handy. Say you have an active log file you want to monitor in real-time, simply run this command in Windows Powershell and see your logs update live on the terminal.


To demonstrate, in the screenshot above, I simply created a script that logs the current timestamp every two seconds on a logfile located at the Desktop. Then I used Powershell to monitor the updates on the terminal.

To do so, simply open Windows PowerShell on your machine and run the following command:

type -wait "logfile.txt"

:)
Share: