mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 17:53:58 +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
|
||||
|
||||
internal const uint ExitCodeSuccess = 0x00000000;
|
||||
internal const uint ExitCodeCtrlBreak = 0xFFFE0000;
|
||||
internal const uint ExitCodeInitFailure = 0xFFFF0000;
|
||||
internal const uint ExitCodeBadCommandLineParameter = 0xFFFD0000;
|
||||
internal const int ExitCodeSuccess = 0;
|
||||
internal const int ExitCodeCtrlBreak = 128+21; // SIGBREAK
|
||||
internal const int ExitCodeInitFailure = 70; // Internal Software Error
|
||||
internal const int ExitCodeBadCommandLineParameter = 64; // Command Line Usage Error
|
||||
|
||||
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09
|
||||
// Removed HandleUnexpectedExceptions infrastructure
|
||||
@ -212,10 +212,7 @@ namespace Microsoft.PowerShell
|
||||
{
|
||||
s_theConsoleHost.ui.WriteErrorLine(ConsoleHostStrings.ConflictingServerModeParameters);
|
||||
}
|
||||
unchecked
|
||||
{
|
||||
return (int)ExitCodeBadCommandLineParameter;
|
||||
}
|
||||
return ExitCodeBadCommandLineParameter;
|
||||
}
|
||||
|
||||
// First check for and handle PowerShell running in a server mode.
|
||||
|
@ -52,6 +52,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||
|
||||
BeforeAll {
|
||||
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
|
||||
$ExitCodeBadCommandLineParameter = 64
|
||||
|
||||
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user