platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

OPS13 Export-MamlCommandHelp creates invalid XML

Open sdwheeler opened this issue 1 year ago • 1 comments

Prerequisites

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

Steps to reproduce

It looks like there is extra (incomplete) XML at the end the file.

It appears that the file ends on line 3450 but there is extra content after.

Expected behavior

$mdfiles = Measure-PlatyPSMarkdown -Path .\Microsoft.PowerShell.PlatyPS\*.md
$mdfiles | Where-Object Filetype -match 'CommandHelp' |
    Import-MarkdownCommandHelp -Path {$_.FilePath} |
    Export-MamlCommandHelp -OutputFolder .\maml
$x = [xml](gc .\maml\Microsoft.PowerShell.PlatyPS\Microsoft.PowerShell.PlatyPS-Help.xml)

Actual behavior

InvalidArgument: Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type."

Error details

See attached screen shot

Environment data

OPS12 build

Visuals

image

sdwheeler avatar Oct 14 '24 20:10 sdwheeler