posh-git icon indicating copy to clipboard operation
posh-git copied to clipboard

Tests break when run under the pwsh 7.3

Open DominikJaniec opened this issue 1 year ago • 0 comments

Currently, tests here are executed within PowerShell 7.2.9.

However, when one executes tests within PowerShell 7.3.3, a few tests using test-vsts-pr alias are failing. I believe it is because of breaking feature toggle: $PSNativeCommandArgumentPassing.

Basically, it prevents pwsh from stripping the " characters from strings passed into executables:

echo.exe "test `"str`""
powershell> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  2364

powershell> $text = "test `"str`""
powershell> Write-Host $text
test "str"
powershell> echo.exe $text
test str
pwsh> $PSVersionTable.PSVersion
Major  Minor  Patch
-----  -----  -----
7      3      3

pwsh> $text = "test `"str`""
pwsh> Write-Host $text
test "str"
pwsh> echo.exe $text
test "str"

I'll look into that.

DominikJaniec avatar Mar 02 '23 00:03 DominikJaniec