From d8b2d1fb0eb9448eda7d5170654028ab06d25621 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 4 May 2016 17:04:48 -0700 Subject: [PATCH] Fix command-line parser to support --parameters --- .../host/msh/CommandLineParameterParser.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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;