diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
index b297c248a1d..8321cb8b810 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
+++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
@@ -182,9 +182,7 @@ internal class CommandLineParameterParser
"noninteractive",
"inputformat",
"outputformat",
-#if !UNIX
"windowstyle",
-#endif
"encodedcommand",
"configurationname",
"file",
@@ -588,9 +586,13 @@ private void ParseHelper(string[] args)
break;
}
}
-#if !UNIX
else if (MatchSwitch(switchKey, "windowstyle", "w"))
{
+#if UNIX
+ WriteCommandLineError(
+ CommandLineParameterParserStrings.WindowStyleArgumentNotImplemented);
+ break;
+#else
++i;
if (i >= args.Length)
{
@@ -611,8 +613,8 @@ private void ParseHelper(string[] args)
string.Format(CultureInfo.CurrentCulture, CommandLineParameterParserStrings.InvalidWindowStyleArgument, args[i], e.Message));
break;
}
- }
#endif
+ }
else if (MatchSwitch(switchKey, "file", "f"))
{
if (!ParseFile(args, ref i, noexitSeen))
diff --git a/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx b/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx
index 7ad30993383..93b299bc817 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx
+++ b/src/Microsoft.PowerShell.ConsoleHost/resources/CommandLineParameterParserStrings.resx
@@ -189,4 +189,7 @@
Invalid argument '{0}', did you mean:
+
+ Parameter -WindowStyle is not implemented on this platform.
+