Last active
May 27, 2022 22:36
-
-
Save JimWolff/1d6dcefff9fa476dd55a08f5b8afcd20 to your computer and use it in GitHub Desktop.
Powershell script that gets the tail of the newest file in the current directory and waits for more content, good for looking at the newest log file in a directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls;$a=gci -Path "$(Get-Location)\*" -Include *.txt,*.log|sort LastAccessTime -Desc|select -f 1;$host.UI.RawUI.WindowTitle=$a.FullName;gc $a.FullName -Tail 10 -Wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment