Make pwsh server modes implicitly not show banner (#17921)

This commit is contained in:
Steve Lee
2022-08-23 10:47:01 -07:00
committed by GitHub
parent a7559e0987
commit da7fa3f771
2 changed files with 8 additions and 4 deletions
@@ -914,21 +914,25 @@ namespace Microsoft.PowerShell
else if (MatchSwitch(switchKey, "socketservermode", "so"))
{
_socketServerMode = true;
_showBanner = false;
ParametersUsed |= ParameterBitmap.SocketServerMode;
}
else if (MatchSwitch(switchKey, "servermode", "s"))
{
_serverMode = true;
_showBanner = false;
ParametersUsed |= ParameterBitmap.ServerMode;
}
else if (MatchSwitch(switchKey, "namedpipeservermode", "nam"))
{
_namedPipeServerMode = true;
_showBanner = false;
ParametersUsed |= ParameterBitmap.NamedPipeServerMode;
}
else if (MatchSwitch(switchKey, "sshservermode", "sshs"))
{
_sshServerMode = true;
_showBanner = false;
ParametersUsed |= ParameterBitmap.SSHServerMode;
}
else if (MatchSwitch(switchKey, "noprofileloadtime", "noprofileloadtime"))
+4 -4
View File
@@ -331,7 +331,7 @@ namespace PSTests.Parallel
Assert.False(cpp.AbortStartup);
Assert.True(cpp.NoExit);
Assert.False(cpp.ShowShortHelp);
Assert.True(cpp.ShowBanner);
Assert.False(cpp.ShowBanner);
Assert.True(cpp.SocketServerMode);
Assert.Null(cpp.ErrorMessage);
}
@@ -348,7 +348,7 @@ namespace PSTests.Parallel
Assert.False(cpp.AbortStartup);
Assert.True(cpp.NoExit);
Assert.False(cpp.ShowShortHelp);
Assert.True(cpp.ShowBanner);
Assert.False(cpp.ShowBanner);
Assert.True(cpp.ServerMode);
Assert.Null(cpp.ErrorMessage);
}
@@ -365,7 +365,7 @@ namespace PSTests.Parallel
Assert.False(cpp.AbortStartup);
Assert.True(cpp.NoExit);
Assert.False(cpp.ShowShortHelp);
Assert.True(cpp.ShowBanner);
Assert.False(cpp.ShowBanner);
Assert.True(cpp.NamedPipeServerMode);
Assert.Null(cpp.ErrorMessage);
}
@@ -382,7 +382,7 @@ namespace PSTests.Parallel
Assert.False(cpp.AbortStartup);
Assert.True(cpp.NoExit);
Assert.False(cpp.ShowShortHelp);
Assert.True(cpp.ShowBanner);
Assert.False(cpp.ShowBanner);
Assert.True(cpp.SSHServerMode);
Assert.Null(cpp.ErrorMessage);
}