diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 814614f93a..d32847a4e1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -365,6 +365,12 @@ namespace Microsoft.PowerShell switchKey = switchKey.Substring(1); + // chop off the second dash so we're agnostic wrt specifying - or -- + if (SpecialCharacters.IsDash(switchKey[0])) + { + switchKey = switchKey.Substring(1); + } + if (MatchSwitch(switchKey, "help", "h") || MatchSwitch(switchKey, "?", "?")) { showHelp = true;