Prevent PowerShell 7.3 from breaking tests#951
Open
DominikJaniec wants to merge 2 commits intodahlbyk:masterfrom
Open
Prevent PowerShell 7.3 from breaking tests#951DominikJaniec wants to merge 2 commits intodahlbyk:masterfrom
DominikJaniec wants to merge 2 commits intodahlbyk:masterfrom
Conversation
e8b5b2e to
a9447e1
Compare
Author
|
Strangely, everything passed 😕 Maybe, Nonetheless, next commit solved problems on my machine 😅 |
DominikJaniec
commented
Mar 3, 2023
|
|
||
| if (-not (Test-Path Variable:PSNativeCommandArgumentPassing) ` | ||
| -or $PSNativeCommandArgumentPassing -eq 'Legacy') { | ||
| $value = $value.Replace("`"", "\`"") |
Author
There was a problem hiding this comment.
I've debated with oneself, if explicit version should be used here:
Suggested change
| $value = $value.Replace("`"", "\`"") | |
| $value = "!f() { exec vsts code pr \`"`$`@\`"; }; f" |
Author
|
I hope, this will be useful, once workflows would run on |
|
Any update on this? I'm missing my posh-git! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
PowerShell 7.3the$PSNativeCommandArgumentPassingbecomes'Standard'. It will break a few tests usingtest-vsts-pralias. 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:This PR is a solution for an issue risen recently by me: #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 version7.2.10, or the same version is in Ubuntu 22.04.