Skip to content

NativeCommandExitException should display "negative" exit codes in hex, not decimal #19886

@sba923

Description

@sba923

Prerequisites

Steps to reproduce

When a native command exits with a "negative" (high-order bit set) exit code, PowerShell 7.4.0-preview.4 displays something like:

NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335212.

This negative value cannot (really) be made sense of unless you convert it to hex (0x8a150014 in that case).

Expected behavior

NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: 0x8a150014.

Actual behavior

NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335212.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.0-preview.4
PSEdition                      Core
GitCommitId                    7.4.0-preview.4
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimeWG-ReviewedA Working Group has reviewed this and made a recommendation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions