Quantcast
Viewing all articles
Browse latest Browse all 3333

PowerTip: Read File with Backtick in Name

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

Image may be NSFW.
Clik here to view.
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?

Image may be NSFW.
Clik here to view.
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

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>