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

Prevent PowerShell 7.3 from breaking tests

Open DominikJaniec opened this issue 1 year ago • 3 comments

With PowerShell 7.3 the $PSNativeCommandArgumentPassing becomes 'Standard'. It will break a few tests using test-vsts-pr alias. In previous versions of PowerShell, this was set or assumed as 'Legacy', and now it will become 'Windows' on that, and 'Standard' everywhere else.

The 'Legacy', as well as the 'Windows' for certain system-ish executables, makes that:

> echo.exe "magic `"str`" quoted"
magic str quoted

This PR is a solution for an issue risen recently by me: https://github.com/dahlbyk/posh-git/issues/950

My first commit should break mentioned tests, and it could be reverted once GitHub workflows start running on PowerShell 7.3. Currently, e.g. image used for Windows 2022 has installed version 7.2.10, or the same version is in Ubuntu 22.04.

DominikJaniec avatar Mar 03 '23 22:03 DominikJaniec

Strangely, everything passed 😕 Maybe, 7.2 does not support $PSNativeCommandArgumentPassing at all.

Nonetheless, next commit solved problems on my machine 😅

DominikJaniec avatar Mar 03 '23 23:03 DominikJaniec

I hope, this will be useful, once workflows would run on PowerShell 7.3

DominikJaniec avatar Mar 03 '23 23:03 DominikJaniec

Any update on this? I'm missing my posh-git!

zhilbug avatar May 12 '23 16:05 zhilbug