Question:
Create a file called Valid[File].txt and stick some text in it. Start powershell and go to the directory.
1 |
gc Valid[File].txt |
should display the value in the file. It returns blank. If you use tab auto-completion it escapes the name:
1 |
gc 'Valid [File ].txt' |
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