PowerTip: Read File with Backtick in Name

Doctor Scripto

Summary: Read the content of a text file with a backtick ( ` ) in the name.

Hey, Scripting Guy! Question How can I use Windows PowerShell to read the content of a file that has a backtick ( ` ) in the file name?

Hey, Scripting Guy! Answer Use single quotation marks around the name when you supply the path to Get-Content, for example:

Get-Content 'c:\fso\a file with a `in the name.txt'

The following examples fail:

Get-Content "c:\fso\a file with a `in the name.txt"

Get-Content c:\fso\a file with a `in the name.txt

0 comments

Discussion is closed.

Feedback usabilla icon