You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-Help removing space on first code line in examples #14656
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help
The behavior is definitely undesirable, but let me point out that you needn't provide a prompt string explicitly at all:
If the first line - only - doesn't have a prefix that ends with >, prefix PS > (sic) is automatically prepended.
If there is a prefix that ends with >, as in your case, any whitespace that follows it is unexpectedly stripped - that is the bug.
An existing prefix with > should be left alone, but only if it starts with PS; otherwise, an unprefixed example command that happens to use > as the redirection operator (e.g., foo > bar.txt) would unexpectedly not receive the default prefix.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help
Activity
mklement0 commentedon Jan 23, 2021
The behavior is definitely undesirable, but let me point out that you needn't provide a prompt string explicitly at all:
If the first line - only - doesn't have a prefix that ends with
>, prefixPS >(sic) is automatically prepended.If there is a prefix that ends with
>, as in your case, any whitespace that follows it is unexpectedly stripped - that is the bug.I think two fixes are called for:
The default prefix should be
PS>, notPS >, to be consistent with existing cmdlet help - PR Fix for #6938 Fixed prompt string to be platform agnostic in examples #7255 made the prefix platform-agnostic, but introduced the undesirable space before>.An existing prefix with
>should be left alone, but only if it starts withPS; otherwise, an unprefixed example command that happens to use>as the redirection operator (e.g.,foo > bar.txt) would unexpectedly not receive the default prefix.wsmelton commentedon Jan 23, 2021
Yeah, but this just looks wrong when you are viewing it from the code on GitHub:
It also causes this to happen when the module is used in Windows PowerShell (prepending the wrong prompt):
If that was consistent through both then I'd agree, but since it is not we have no choice but to always include it.
iSazonov commentedon Jan 24, 2021
It seems to be more convenient if this code was copyable and executable - remove "PS>" prefix and add "#" before text.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.