diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index a04a7edd4..bd08b0e3c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -173,28 +173,29 @@ namespace Microsoft.PowerShell private const int MaxPipePathLengthMacOS = 104; internal static string[] validParameters = { - "version", - "nologo", - "noexit", #if STAMODE "sta", "mta", #endif - "noprofile", - "noninteractive", - "inputformat", - "outputformat", - "windowstyle", - "encodedcommand", - "configurationname", - "file", - "executionpolicy", "command", - "settingsfile", + "configurationname", + "custompipename", + "encodedcommand", + "executionpolicy", + "file", "help", - "workingdirectory", + "inputformat", + "loadprofile", + "noexit", + "nologo", + "noninteractive", + "noprofile", + "outputformat", "removeworkingdirectorytrailingcharacter", - "custompipename" + "settingsfile", + "version", + "windowstyle", + "workingdirectory" }; internal CommandLineParameterParser(PSHostUserInterface hostUI, string bannerText, string helpText) @@ -742,6 +743,10 @@ namespace Microsoft.PowerShell _noExit = true; noexitSeen = true; } + else if (MatchSwitch(switchKey, "loadprofile", "l")) + { + // do nothing as we load profile by default, but this is needed to be compatible with POSIX shell expectations + } else if (MatchSwitch(switchKey, "noprofile", "nop")) { _skipUserInit = true;