dahlbyk / posh-git

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

Prevent PowerShell 7.3 from breaking tests #951

Open DominikJaniec opened 1 year ago

DominikJaniec commented 1 year ago

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 commented 1 year ago

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

Nonetheless, next commit solved problems on my machine 😅

DominikJaniec commented 1 year ago

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

zhilbug commented 1 year ago

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