functions/tail-log.ps1
function get-log { [CmdletBinding()] param($logdir = "log", $last = 100, [switch][bool]$wait = $true) ipmo require req process $logfile = ls $logdir | sort LastWriteTime -Descending | select -first 1 if ($logfile -eq $null) { throw "no log files found in dir $logdir" } write-verbose "following log file '$logfile'" $logfile | get-content -last $last -wait:$wait #| write-indented -mark "$logfile > " } new-alias tail-log get-log -Force |