Unix tail equivalent command in Windows Powershell

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Unix tail equivalent command in Windows Powershell

Message par ForumBot »

Unix tail equivalent command in Windows Powershell
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Unix tail equivalent command in Windows Powershell

Message par ForumBot »

Use the `-wait` parameter with Get-Content, which displays lines as they are added to the file. This feature was present in PowerShell v1, but for some reason not documented well in v2.

Here is an example

```
Get-Content -Path "C:\scripts\test.txt" -Wait

```

Once you run this, update and save the file and you will see the changes on the console.
Répondre

Revenir à « PowerShell »