Remove use of -EncodedCommand when executing powershell/pwsh
What does this MR do?
Removes the use of -EncodedCommand
.
Why was this MR needed?
In !3707 (merged), to ensure that Powershell executes UTF-8 encoded scripts correctly, we first had to configure an outer powershell environment forcing UTF-8 encoding.
-EncodedCommand
was used for the outer command so that we didn't need to escape any PowerShell and due to EncodedCommand
always using UTF-16. Although this was a more complex fix, the rationale was that because Powershell isn't having to guess the encoding (the problem we were fixing), the outer script would never suffer a similar bug.
Unfortunately, the use of -EncodedCommand
with Windows Powershell (but not Powershell Core) adds verbose XML progress logs to stderr
, which we're unable to silence.
-EncodedCommand
should hopefully not be required, because the current script doesn't need complex escaping (just single quotes) and is comprised of only ASCII
What's the best way to test this MR?
TestPowershellUTF8EncodingStdin
should be enough to ensure that this still works.
We can also hopefully reach out to some members of the community that previous had the encoding edge-cases to see if they're available to test if the problem is indeed still fixed.
What are the relevant issue numbers?
Closes #29462 (closed)