Skip to content

Import-MarkdownCommandHelp: Index was outside the bounds of the array #734

@sdwheeler

Description

@sdwheeler

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Not sure what is wrong with this one. However, this command has no parameters.

Get-MPIOSetting.md

PS> Import-MarkdownCommandHelp .\Get-MPIOSetting.md
Import-MarkdownCommandHelp: Index was outside the bounds of the array.

Expected behavior

Should import the markdown without error.

Actual behavior

Error:
Import-MarkdownCommandHelp: Index was outside the bounds of the array.

Error details

Get-Error

Exception             :
    Type       : System.IndexOutOfRangeException
    TargetSite :
        Name          : ThrowIndexOutOfRangeException
        DeclaringType : [Markdig.Helpers.ThrowHelper]
        MemberType    : Method
        Module        : Markdig.Signed.dll
    Message    : Index was outside the bounds of the array.
    Source     : Markdig.Signed
    HResult    : -2146233080
    StackTrace :
   at Markdig.Helpers.ThrowHelper.ThrowIndexOutOfRangeException()
   at Microsoft.PowerShell.PlatyPS.MarkdownConverter.GetExamples(ParsedMarkdownContent mdc, Int32 startIndex)
   at Microsoft.PowerShell.PlatyPS.MarkdownConverter.GetExamplesFromMarkdown(ParsedMarkdownContent markdownContent,
List`1& diagnostics)
   at Microsoft.PowerShell.PlatyPS.MarkdownConverter.GetCommandHelpFromMarkdown(ParsedMarkdownContent markdownContent)
   at Microsoft.PowerShell.PlatyPS.MarkdownConverter.GetCommandHelpFromMarkdownFile(String path)
   at Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand.ProcessRecord()
TargetObject          : D:\Git\Windows\winps-docs-archive-pr\docset\winserver2012-ps\MPIO\Get-MPIOSetting.md
CategoryInfo          : InvalidOperation: (D:\Git\Windows\winp…\Get-MPIOSetting.md:String)
[Import-MarkdownCommandHelp], IndexOutOfRangeException
FullyQualifiedErrorId : FailedToImportMarkdown,Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand
InvocationInfo        :
    MyCommand        : Import-MarkdownCommandHelp
    ScriptLineNumber : 1
    OffsetInLine     : 6
    HistoryId        : 124
    Line             : $c = import-MarkdownCommandHelp docset\winserver2012-ps\MPIO\Get-MPIOSetting.md
    Statement        : import-MarkdownCommandHelp docset\winserver2012-ps\MPIO\Get-MPIOSetting.md
    PositionMessage  : At line:1 char:6
                       + $c = import-MarkdownCommandHelp docset\winserver2012-ps\MPIO\Get-MPIO …
                       +      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : import-MarkdownCommandHelp
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
      0
      1

Environment data

Microsoft.PowerShell.PlatyPS built from latest commit in v2 branch - 33b90b4

Visuals

No response

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions