Get-Content with wait parameter is not updated in Powershell

I am trying to control a file using Get-Content $path -wait in Windows Powershell V3.0. Sometimes, when I run this command line in Powershell, it will function properly. But sometimes it will execute (or at least seem to) get-content , but without the -wait parameter. Although the file is being updated, it will not be shown in Powershell. If I cancel the command and repeat it, it will show the updated contents of the file.

What do I need to do?

EDIT: It seems to update the blocks after a while. But it really is not in real time.

+4
source share
1 answer

It is not allowed to comment (do not have a reputation of 50), so you need to give an answer ....

Less for Windows ( http://gnuwin32.sourceforge.net/packages/less.htm ) with the + F or Shift-F option ( http://www.commandlinefu.com/commands/view/1024/make-less-behave -like-tail-f .) showed the updated contents of the file where PowerShell "get-content $ path -wait" did not.

0
source

Source: https://habr.com/ru/post/1489087/


All Articles