Skip to content

powershell: Fix commands no longer executing

Stan Hu requested to merge sh-always-disable-powershell-stdin into main

!3831 (merged) reverted the change for passing parameters via stdin with -EncodedCommand with powershell but kept this for pwsh. However, there appear to be some issues using -Command in some cases. Jobs can fail with:

echo : The term ' echo' is not recognized as the name of a cmdlet,
function, script file, or operable program.  Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1

It appears that including the UTF-8 BOM may be causing problems with -Command, and thus we should revert to the previous behavior of passing the command via file.

Relates to #29551 (closed)

Edited by Stan Hu

Merge request reports