Forum Discussion
Michael_Buchner
Mar 27, 2020Brass Contributor
Escaping in strings and cmdlets
I have observed a pretty weird behaviour when handling file paths containing square brackets - yes, that's rare but it happens. Square brackets are escaped using the backtick, for example C:\[di...
Erick A. Moreno R.
Mar 27, 2020Iron Contributor
Michael_Buchner Hello Michael, I use the single quote for paths and strings so when I have to scape a char I just use one backtick.
This should work for all cmdlets.
New-Item -ItemType Junction -Path 'C:\dir1' -Target 'C:\`[dir2`]'
Regards
Erick Moreno