Change PowerShell double quotes escape

It changes the way privacy.sexy escape double quotes inside batch
command when running PowerShell scripts as an argument to
PowerShell.exe. It uses more robust and stable way offering support for
wider use-cases.
This commit is contained in:
undergroundwires
2021-10-17 15:37:06 +01:00
parent 236a0f6c82
commit 9aa8166891
2 changed files with 20 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ describe('EscapeDoubleQuotes', () => {
{
name: 'using "',
input: 'hello "world"',
expectedOutput: 'hello \\"world\\"',
expectedOutput: 'hello "^""world"^""',
},
{
name: 'not using any double quotes',
@@ -20,7 +20,7 @@ describe('EscapeDoubleQuotes', () => {
{
name: 'consecutive double quotes',
input: '""hello world""',
expectedOutput: '\\"\\"hello world\\"\\"',
expectedOutput: '"^"""^""hello world"^"""^""',
},
{
name: 'returns undefined when if input is undefined',