Tail a log file live with Get-Content -Tail -Wait
PowerShell's built-in tail -f — show the last N lines and keep streaming new ones as the log grows.
01Command
$ Get-Content 'C:\Logs\app.log' -Tail 20 -Wait02What it does
-Wait polls the file roughly once per second and emits appended lines, so it behaves like tail -f; -Tail controls the starting window. Since output is the normal pipeline you can filter live: ... -Wait | Select-String 'ERROR'. -Tail also works without -Wait for a one-shot look at the end of a huge file.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Get-Content - PowerShellEvidence: SS64 lists -Tail and -Wait parameters, noting -Wait polls the file and outputs new lines when added.
- Get-Content | Microsoft LearnEvidence: Microsoft documents Get-Content -Tail <n> to return the last n lines and -Wait to keep the file open and emit new lines as they are appended.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Search inside text files and logs with regex, returning file, line number and match.