Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ private void ShowHelp()
Dbg.Assert(_helpText != null, "_helpText should not be null");
_hostUI.WriteLine("");
_hostUI.Write(_helpText);
if (_showExtendedHelp)
{
_hostUI.Write(ManagedEntranceStrings.ExtendedHelp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this show both UsageHelp and ExtendedHelp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 396 already show UsageHelp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it!

}
_hostUI.WriteLine("");
}

Expand Down Expand Up @@ -536,6 +540,7 @@ private void ParseHelper(string[] args)
else if (MatchSwitch(switchKey, "help", "h") || MatchSwitch(switchKey, "?", "?"))
{
_showHelp = true;
_showExtendedHelp = true;
_abortStartup = true;
}
else if (MatchSwitch(switchKey, "noexit", "noe"))
Expand Down Expand Up @@ -955,7 +960,7 @@ bool TryGetBoolValue(string arg, out bool boolValue)
}
WriteCommandLineError(
string.Format(CultureInfo.CurrentCulture, CommandLineParameterParserStrings.ArgumentFileDoesNotExist, args[i]),
showBanner: false);
showHelp: true);
return false;
}

Expand Down Expand Up @@ -1164,6 +1169,7 @@ private bool CollectArgs(string[] args, ref int i)
private string _configurationName;
private PSHostUserInterface _hostUI;
private bool _showHelp;
private bool _showExtendedHelp;
private bool _showBanner = true;
private bool _noInteractive;
private string _bannerText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static int Start(string consoleFilePath, [MarshalAs(UnmanagedType.LPArray
var formattedBanner = string.Format(CultureInfo.InvariantCulture, banner, PSVersionInfo.GitCommitId);
exitCode = Microsoft.PowerShell.ConsoleShell.Start(
formattedBanner,
ManagedEntranceStrings.ShellHelp,
ManagedEntranceStrings.UsageHelp,
args);
}
catch (System.Management.Automation.Host.HostException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.</value>
</data>
<data name="ShellHelp" xml:space="preserve">
<data name="UsageHelp" xml:space="preserve">
<value>Usage: pwsh[.exe] [[-File] &lt;filePath&gt; [args]]
[-Command { - | &lt;script-block&gt; [-args &lt;arg-array&gt;]
| &lt;string&gt; [&lt;CommandParameters&gt;] } ]
Expand All @@ -137,7 +137,10 @@ Type 'help' to get help.</value>

PowerShell Online Help https://aka.ms/pscore6-docs

All parameters are case-insensitive.
All parameters are case-insensitive.</value>
</data>
<data name="ExtendedHelp" xml:space="preserve">
<value>

-Command | -c
Executes the specified commands (and any parameters) as though they were typed
Expand Down