X

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\

Karim Buzdar: About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various websites.
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings