dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

Tests break when run under the pwsh 7.3 #950

Open DominikJaniec opened 1 year ago

DominikJaniec commented 1 year ago

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.