How do I reference files with brackets in the name

Question:

Create a file called Valid[File].txt and stick some text in it. Start powershell and go to the directory.

should display the value in the file. It returns blank. If you use tab auto-completion it escapes the name:

but still returns nothing.

How do I reference files with brackets in their names?

Answer:

Turns out the key was -literalpath. For details see this technet article

Source:

How do I reference files with brackets in the name by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply