Windows PowerShell Home
get-content -wait does not follow a file
7/7/2013 11:58:48 PM
User(s) can reproduce this bug
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
How often does this happen?
Have you seen this problem before in this product?
Yes, this happens in previous released versions
$twtl= new-object diagnostics.TextWriterTraceListener "C:\temp\test.txt",
[diagnostics.trace]::WriteLine("trace another thing")
Another console with get-content "c:\temp\test.txt -wait will just not update
output of the added lines
to post a comment.
Please enter a comment.
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.
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.
on 11/28/2013 at 7:39 AM
Worked in 2003 Server but not in 2012R2 :(
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...)
to post a workaround.
Please enter a workaround.
© 2014 Microsoft