Powershell stop-parsing symbol (--%), works unexpectedly with escaped single quotes.
echo "HI" > 'test file.txt'
&"cmd.exe" "--%" "/c type `'test file.txt`'"
Must print 'HI'
Prints error:
The system cannot find the file specified.
Error occurred while processing: 'test.
The system cannot find the file specified.
Error occurred while processing: file.txt'.
But with it works if i escape double quoutes
echo "HI" > 'test file.txt'
&"cmd.exe" "--%" "/c type `"test file.txt`""
Name Value
---- -----
PSVersion 6.2.2
PSEdition Core
GitCommitId 6.2.2
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
I didn't think cmd respected single quotes in the same way PowerShell does?
Yeah, shame on me. Spent all day struggling with a ghost >_<.
Sorry to bother.