Friday, November 22, 2019

Tail in PowerShell

 I need to "tail" in PowerShell to view the log and found the following command interesting:

> Get-Content C:\mylog.txt -Wait

If you want to get the latest file and tail it:

> Get-Content ( Get-ChildItem C:\Folder\ | Sort-Object LastWriteTime | Select-Object -Last 1) -Wait