Skip to content

Export-MamlCommandHelp omits the related link to the online content #788

@sdwheeler

Description

@sdwheeler

Prerequisites

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

Steps to reproduce

ConvertTo-Csv.md

Import-MarkdownCommandHelp .\Microsoft.PowerShell.Utility\ConvertTo-Csv.md |
    Export-MamlCommandHelp -OutputFolder .\v2

Expected behavior

In the related links section of the MAML, the online version URL aka HelpUri should be the first item in the list. This is the example MAML snippet produced by v0.14.

    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version:</maml:linkText>
        <maml:uri>https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.5&amp;WT.mc_id=ps-gethelp</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>ConvertFrom-Csv</maml:linkText>
        <maml:uri></maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Export-Csv</maml:linkText>
        <maml:uri></maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Import-Csv</maml:linkText>
        <maml:uri></maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>

Actual behavior

<command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>ConvertFrom-Csv</maml:linkText>
        <command:uri>ConvertFrom-Csv.md</command:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Export-Csv</maml:linkText>
        <command:uri>Export-Csv.md</command:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>Import-Csv</maml:linkText>
        <command:uri>Import-Csv.md</command:uri>
      </maml:navigationLink>
    </command:relatedLinks>

Error details

When you try to use the HelpUri, you get the following error:

Get-Help convertto-csv -Online
Get-Help: The specified URI ConvertFrom-Csv.md is not valid.

Environment data

Microsoft.PowerShell.PlatyPS v1.0.0 GA

Version

Microsoft.PowerShell.PlatyPS v1.0.0 GA

Visuals

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions