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.
Related Posts:
- Setting Windows PowerShell environment variables
- How to find the Windows version from the PowerShell command line
- How do I start PowerShell from Windows Explorer?
- How to run a PowerShell script
- Connect-AzAccount – how to avoid azure device authentication?
- How do I concatenate strings and variables in PowerShell?
- PowerShell equivalent to grep -f
- Running a command as Administrator using PowerShell?
- How do I concatenate strings and variables in PowerShell?
- Replace substring in PowerShell
- Echo equivalent in PowerShell for script testing
- Echo equivalent in PowerShell for script testing
- PowerShell says “execution of scripts is disabled on this system.”
- How to use the curl command in PowerShell?
- How to run a PowerShell script
- PowerShell and the -contains operator
- Change directory in PowerShell
- How to handle command-line arguments in PowerShell
- Splitting a string into separate variables
- How to split string by string in Powershell
- How to split string by string in Powershell
- How to export data to CSV in PowerShell?
- Downloading a file with PowerShell
- Terminating a script in PowerShell
- How to run an EXE file in PowerShell with parameters with spaces and quotes
- How to run an EXE file in PowerShell with parameters with spaces and quotes
- Terminating a script in PowerShell
- Prompt for user input in PowerShell
- How to upgrade PowerShell version from 2.0 to 3.0
- How do I concatenate strings and variables in PowerShell?
- Array.Add vs +=
- PowerShell and the -contains operator
- PowerShell string interpolation syntax
- How to write to the console in PowerShell?
- Function return value in PowerShell
- PowerShell ‘Or’ Statement
- powershell -Or operator not working
- How to decode a Base64 string?
- Copy file remotely with PowerShell
- Read file line by line in PowerShell
- Path to Powershell.exe (v 2.0)
- Azure Powershell Select-AzureSubscription with subscription id
- How to unzip a file in Powershell?
- You cannot call a method on a null-valued expression
- How can I replace every occurrence of a String in a file with PowerShell?
- Create directory if it does not exist
- Copy-Item is overwriting by default
- The term ‘Get-ADUser’ is not recognized as the name of a cmdlet
- How to print environment variables to the console in PowerShell?
- The term ‘nmake’ is not recognized
- Ternary operator in PowerShell
- How to run PowerShell in CMD
- Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
- Call PowerShell script PS1 from another PS1 script inside Powershell ISE
- Does PowerShell has something like “echo off” and “echo on” trigger?
- Convert a string to datetime in PowerShell
- LDAP query in PowerShell
- PowerShell: Comparing dates
- Press any key to continue
- How do I get the current username in Windows PowerShell?
- accessing the $args array in powershell
- Create a function with optional call variables
- How do I do ‘dir /s /b’ in PowerShell?
- Create Log File in Powershell
- What does the & symbol in powershell mean?
- What does the double asterisks mean?
- How to enter a multi-line command
- Difference between $? and $LastExitCode in PowerShell
- How to break lines in PowerShell?
- How to tell PowerShell to wait for each command to end before starting the next?
- How to convert string to integer in PowerShell
- How do I force Robocopy to overwrite files?
- Powershell: GetType used in PowerShell, difference between variables
- One Powershell Script calling another with parameters
- Concatenate files using PowerShell
- Passing multiple values to a single PowerShell script parameter
- Upload files with FTP using PowerShell
- Powershell send-mailmessage – email to multiple recipients
- Sometimes PowerShell stops sending output until I press enter. Why?
- How do I diff two text files in Windows Powershell?
- In a PowerShell script, how can I check if I’m running with administrator privileges?
- What is the literal escape character in Powershell?
- outputting ascii table in C++
- Tensorflow import error: No module named ‘tensorflow’
- A fatal error occurred while creating a TLS client credential. The internal error state is 10013
- How can I install pip on Windows?
- bash: npm: command not found?
- What languages are Windows, Mac OS X and Linux written in?
- stop all instances of node.js server
- Windows Activator .bat Text
- “rm -rf” equivalent for Windows?
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- Windows 7 – ‘make’ is not recognized as an internal or external command, operable program or batch file
- ImportError: No module named cv2
- Posting with slug “favicon” gets redirected
- Offline WordPress Application
- WordPress on XAMPP over my home network [closed]
- Does WordPress Support Using Named Pipes on the Windows Operating System?
- How can I tell what version of IIS is installed?
- How to zip/unzip files in Powershell?