Page 1 of 1

Double Quotes embedded in Double Quotes

Posted: 2022-Jul-20, 5:58 pm
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

Re: Double Quotes embedded in Double Quotes

Posted: 2022-Jul-20, 7:14 pm
by Simon Sheppard
OK that's done, I also added a couple of alternatives :)

Re: Double Quotes embedded in Double Quotes

Posted: 2022-Jul-20, 8:24 pm
by Gregor Y
thanks, I also noticed this version works as well

Code: Select all

powershell.exe -command "&{$m = \"hello world\";write-host $m}"

Re: Double Quotes embedded in Double Quotes

Posted: 2022-Jul-20, 8:34 pm
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