Explicitly set PSNativeCommandArgumentPassing to Legacy for git push script (#4481)

https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
Do to that breaking change in PS 7.3 we need to opt into the legacy arg parsing.

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
Azure SDK Bot 2023-03-24 11:12:14 -07:00 committed by GitHub
parent 2a39a3422b
commit e9f900f7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,10 @@ param(
[boolean] $AmendCommit = $false
)
# Explicit set arg parsing to Legacy mode because some of the git calls in this script depend on empty strings being empty and not passing a "" git.
# more info https://learn.microsoft.com/en-us/powershell/scripting/learn/experimental-features?view=powershell-7.3#psnativecommandargumentpassing
$PSNativeCommandArgumentPassing = "Legacy"
# This is necessary because of the git command output writing to stderr.
# Without explicitly setting the ErrorActionPreference to continue the script
# would fail the first time git wrote command output.