get-content -wait does not follow a file - by Serve Laurijssen

Status : 


Sign in
to vote
ID 792983 Comments
Status Active Workarounds
Type Bug Repros 10
Opened 7/7/2013 11:58:48 PM
Access Restriction Public


Consider the following situation:

Theres one application writing to a file with the CLR object System.Diagnostics.Trace

Windows powershell tries to follow the file with get-content "file" -wait

But whenever a line is added to the file it wont show up in the powershell console.

Would be nice if this was fixed as it makes downloading tools for this unnessecary

Sign in to post a comment.
Posted by Serve Laurijssen on 5/7/2015 at 11:44 PM
Al right, that explains why but it won't fix anything since System.Diagnostics.Trace does not reopen files and therefore does not update the Last Modified property
Posted by Nathan Hartley on 5/7/2015 at 2:37 PM
I found a ServerFault entry that I believe explains the problem well (
Posted by Mark Keisling Jr on 5/15/2014 at 11:15 PM
I have experienced this on V2 and V4.
-Wait will follow log file for a while, but then stop. Sometimes it will randomly pick back up at some point, others it will go hours without ever returning the new lines in the file.
Posted by Mr. Joe M. _ on 12/5/2013 at 5:58 PM
I see this on my 2008 R2 server when trying to tail the logfile created by robocopy. Over 1hr and updates have not yet appeared.
Posted by CryptMan on 11/28/2013 at 7:39 AM
Worked in 2003 Server but not in 2012R2 :(
Posted by petargolubovic on 8/21/2013 at 7:05 AM
Yep, I can only second this - have tried it 3-4 times on various machines, and the file which was updating in the background was never actually 'tailed'.

Would be good if it was fixed, too many logs to deal with (and too many Linux guys smirking...)