Microsoft Windows
-
Gregor Y
- Posts: 3
- Joined: 2022-Jul-20, 5:40 pm
Post
by Gregor Y »
Hi there,
Can you please add the following example on how to embed double quotes to the "Using "Double Quotes"" section of the
Escape Characters page.
Code: Select all
powershell.exe -command "&{$m = "\""hello world"\"";write-host $m}"
Thanks!
this is also helpful with commands like
Code: Select all
sqlplus user/\""password with spaces"\"@service
-
Gregor Y
- Posts: 3
- Joined: 2022-Jul-20, 5:40 pm
Post
by Gregor Y »
thanks, I also noticed this version works as well
Code: Select all
powershell.exe -command "&{$m = \"hello world\";write-host $m}"
-
Gregor Y
- Posts: 3
- Joined: 2022-Jul-20, 5:40 pm
Post
by Gregor Y »
that in turn leads to this one working in Windows-PowerShell v5.1(non ISE)
Code: Select all
PS C:\Working\Path> powershell.exe -command '$m=\"hello world\";write-host $m'
which I would not have expected