Skip to content

Instantly share code, notes, and snippets.

@JimWolff
Last active May 27, 2022 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JimWolff/1d6dcefff9fa476dd55a08f5b8afcd20 to your computer and use it in GitHub Desktop.
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.
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