-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-Help shows incorrect spacing and unwanted prefixes for first line of .EXAMPLE text #23814
Comments
I do not view
As a workaround you can use |
@237dmitry Your examples do not correspond to the details I provided in the Steps to Reproduce section above. The specific text formatting is significant, otherwise the issue will not present itself. I can provide cut-down versions of the .psm1 and .psd1 files I am using, if that would help. |
@237dmitry, the issue is about comment-based help, whereas built-in cmdlets come with external, MAML-based help files (though the discrepancy in the resulting behavior is surprising). Here's how things currently work:
Thus:
|
Thank you both. The workaround from @237dmitry does not work for me without using the special Unicode character for the space; otherwise, any spaces are removed. So:
instead of:
The default behaviour, as detailed by @mklement0, is problematic for a number of reasons:
All we get for a header is the example number, e.g.
The whitespace-eating bug is annoying. I'm not keen on embedding special characters to get around this issue, but appreciate the advice. The other option is to leave out the In conclusion, I think a reasonable expectation from running For this reason, I think the If the prefix remains in future versions, it should obviously be documented, and not left as a surprise for the developer 😀 |
I always wondered why there wasn't a way to add additional details after Wishful thinking Function Test-Function {
<#
.EXAMPLE Some additional details
Test-Function
<#
} |
Thank you @daverayment for this issue. The Interactive working group had reviewed this and agrees there is a bug in the comment based help causing the space. |
Prerequisites
Steps to reproduce
I am writing a PowerShell module and adding help text for each of my exported cmdlets.
Several of my commands include multi-line examples, showing the command usage and example output, e.g.:
I have tested my module in both Visual Studio Code's PowerShell terminal and also a separate instance of PowerShell in Terminal. When calling
Get-Help Get-MTPDeviceList
with switches that show example text (e.g.-Full
or-Examples
), the formatting of the displayed examples text is incorrect.Specifically:
#
), the text "PS >" is inserted before it.Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: