Describe "Native Command Arguments" -tags "CI" { $testPath = 'TestDrive:\test.txt' $powershellTestDir = $PSScriptRoot while ($powershellTestDir -notmatch 'test[\\/]powershell$') { $powershellTestDir = Split-Path $powershellTestDir } $echoArgs = Join-Path (Split-Path $powershellTestDir) tools/EchoArgs/run/echoargs It "Should handle quoted spaces correctly" { $a = 'a"b c"d' & $echoArgs $a 'a"b c"d' a"b c"d >$testPath $testPath | Should Contain 'Arg 0 is ' $testPath | Should Contain 'Arg 1 is ' $testPath | Should Contain 'Arg 2 is ' } It "Should handle spaces between escaped quotes" { & $echoArgs 'a\"b c\"d' "a\`"b c\`"d" >$testPath $testPath | Should Contain 'Arg 0 is ' $testPath | Should Contain 'Arg 1 is ' } }