How to Read a Text File Using PowerShell

You can read a text file and display its content using get-content cmdlet in PowerShell.

Read textfile example

Execute the following command on PowerShell with elevated privileges.

Get-Content c:\scripts\test.txt

This command will display the contents of the file test.txt which is located in c:\scripts\

Leave a Comment