KEMBAR78
`Start-Process` in 7.5.0: invalid handles, no output emitted on Windows · Issue #24986 · PowerShell/PowerShell · GitHub
Skip to content

Start-Process in 7.5.0: invalid handles, no output emitted on Windows #24986

@ltrzesniewski

Description

@ltrzesniewski

Prerequisites

Steps to reproduce

Run the following on Windows:

Start-Process -Wait -NoNewWindow -RedirectStandardError tmp.txt -FilePath cmd -ArgumentList "/C echo Hello"

Expected behavior

This should output `Hello` and produce an empty `tmp.txt` file.

Actual behavior

On Windows:
- There is no stdout output
- A `tmp.txt` file is produced, with the following content: `The handle is invalid.`

On WSL, everything works as expected, but the command needs to be adjusted:


Start-Process -Wait -NoNewWindow -RedirectStandardError tmp.txt -FilePath bash -ArgumentList '-c "echo Hello"'

Error details

PowerShell does not return an error, `Get-Error` doesn't return anything.

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

7.5.0:

Image

5.1, but the same thing happens in 7.4:

Image

Metadata

Metadata

Assignees

Labels

7.5-regressionThe issue is a regressionIssue-BugIssue has been identified as a bug in the productWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions