Skip to content

Get-Help -ShowWindow crashes the shell in 7.4.0-preview.4 #20049

@sba923

Description

@sba923

Prerequisites

Steps to reproduce

Get-Help ...\ScriptWithCommentBasedHelp.ps1 -ShowWindow triggers an unhandled exception in 7.4.0-preview.4, but works fine with 7.3.6

Repro script:

ScriptWithCommentBasedHelp.zip

Expected behavior

Get-Help ...\ScriptWithCommentBasedHelp.ps1 -ShowWindow
# no error, help is displayed in separate window

Actual behavior

Get-Help ...\ScriptWithCommentBasedHelp.ps1 -ShowWindow
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit.
Unhandled exception. System.ArgumentOutOfRangeException: 1 ('1') must be greater than or equal to '8'. (Parameter '1')
Actual value was 1.
   at System.ArgumentOutOfRangeException.ThrowLess[T](String paramName, T value, T other)
   at System.ArgumentOutOfRangeException.ThrowIfLessThan[T](T value, T other, String paramName)
   at Microsoft.Management.UI.Internal.ParagraphBuilder.TextSpan..ctor(Int32 start, Int32 length)
   at Microsoft.Management.UI.Internal.ParagraphBuilder.AddText(String str, Boolean bold)
   at Microsoft.Management.UI.Internal.HelpParagraphBuilder.AddStringSection(Boolean setting, String sectionName, String sectionTitle)
   at Microsoft.Management.UI.Internal.HelpParagraphBuilder.AddTextToParagraphBuilder()
   at Microsoft.Management.UI.Internal.HelpViewModel..ctor(PSObject psObj, Paragraph documentParagraph)
   at Microsoft.Management.UI.HelpWindow..ctor(PSObject helpObject)
   at Microsoft.PowerShell.Commands.Internal.HelpWindowHelper.<>c__DisplayClass0_0.<ShowHelpWindow>b__1()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

[process exited with code 3762504530 (0xe0434352)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.0-preview.4
PSEdition                      Core
GitCommitId                    7.4.0-preview.4
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productWG-Interactive-HelpSystemhelp infrastructure and formatting of help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions