Create a file called Valid[File].txt and stick some text in it. Start powershell and go to the directory.
gc Valid[File].txtshould display the value in the file. It returns blank. If you use tab auto-completion it escapes the name:
gc 'Valid[File
].txt'
but still returns nothing.
How do I reference files with brackets in their names?
Turns out the key was -literalpath
. For details see this technet article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With