[release/v7.5] Set standard handles explicitly when starting a process with `-NoNewWindow` by pwshBot · Pull Request #25324 · PowerShell/PowerShell

Backport of #25061 to release/v7.5

Triggered by @TravisEz13 on behalf of @daxian-dbw

Original CL Label: CL-General

/cc @PowerShell/powershell-maintainers

Impact

Choose either tooling or Customer impact.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Customer Impact

  • Customer reported
  • Found internally

When using Start-Process with -NoNewWindow, the output of the process will be messed up. See the "expected behaviors" and "actual behaviors" in the original issue.

Regression

  • Yes
  • No

Introduced in 7.5

Testing

Added a test

Risk

  • High
  • Medium
  • Low

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]