mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-24 02:04:07 +08:00
Update powershell console exit codes to match Unix standards
This commit is contained in:
parent
d9c63b7218
commit
4c22b10a38
@ -53,10 +53,10 @@ namespace Microsoft.PowerShell
|
|||||||
{
|
{
|
||||||
#region static methods
|
#region static methods
|
||||||
|
|
||||||
internal const uint ExitCodeSuccess = 0x00000000;
|
internal const int ExitCodeSuccess = 0;
|
||||||
internal const uint ExitCodeCtrlBreak = 0xFFFE0000;
|
internal const int ExitCodeCtrlBreak = 128+21; // SIGBREAK
|
||||||
internal const uint ExitCodeInitFailure = 0xFFFF0000;
|
internal const int ExitCodeInitFailure = 70; // Internal Software Error
|
||||||
internal const uint ExitCodeBadCommandLineParameter = 0xFFFD0000;
|
internal const int ExitCodeBadCommandLineParameter = 64; // Command Line Usage Error
|
||||||
|
|
||||||
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09
|
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09
|
||||||
// Removed HandleUnexpectedExceptions infrastructure
|
// Removed HandleUnexpectedExceptions infrastructure
|
||||||
@ -212,10 +212,7 @@ namespace Microsoft.PowerShell
|
|||||||
{
|
{
|
||||||
s_theConsoleHost.ui.WriteErrorLine(ConsoleHostStrings.ConflictingServerModeParameters);
|
s_theConsoleHost.ui.WriteErrorLine(ConsoleHostStrings.ConflictingServerModeParameters);
|
||||||
}
|
}
|
||||||
unchecked
|
return ExitCodeBadCommandLineParameter;
|
||||||
{
|
|
||||||
return (int)ExitCodeBadCommandLineParameter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// First check for and handle PowerShell running in a server mode.
|
// First check for and handle PowerShell running in a server mode.
|
||||||
|
@ -52,6 +52,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
|||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
|
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
|
||||||
|
$ExitCodeBadCommandLineParameter = 64
|
||||||
|
|
||||||
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
|
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user