Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reference files with brackets in the name

Tags:

powershell

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

gc Valid[File].txt
should 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?

like image 451
Brian Adams Avatar asked Nov 09 '08 07:11

Brian Adams


1 Answers

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

like image 93
Brian Adams Avatar answered Sep 21 '22 19:09

Brian Adams