Skip to content

New-ExternalHelp fails if Module markdown file has a dash at 'ModuleName Cmdlets' #447

Closed
@justin-p

Description

@justin-p

I have an issue regarding the generation process of external help files. Whenever I'm using a module with a dash in its name, platyPS returns an error.
The funny thing is that whenever I rename the module it just works perfectly fine.

Steps to reproduce

Created two markdown files in the .\docs directory:

  • Invoke-Test.md
  • Module-Justin.md

Module-Justin.md is a module markdown file with the following contents:


---
Module Name: Module-Justin
Module Guid: 83e2fda1-15b1-4f84-92ff-a92525bb48ab
Download Help Link: http://localhost/release/Module-Justin/docs/Module-Justin.md
Help Version: 0.0.1
Locale: en-US
---

# Module-Justin Module
## Description
blablablaaaa

## Module-Justin Cmdlets
### [Invoke-Test](Invoke-Test.md)
TBD

Invoke-Test.md:

---
external help file: Module-Justin-help.xml
Module Name: Module-Justin
online version: http://localhost
schema: 2.0.0
---

# Invoke-Test

## SYNOPSIS
TBD

## SYNTAX
Invoke-Test [<CommonParameters>]
 
## DESCRIPTION
TBD

## EXAMPLES

### EXAMPLE 1
TBD
 
## PARAMETERS

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES
Author: Justin

## RELATED LINKS

[http://localhost](http://localhost)

Ran this command to generate external help:

New-ExternalHelp -Path ".\docs" -OutputPath ".\en-US" -Force

Expected behavior

platyPS New-ExternalHelp should work with module .md files that contain a dash.

Actual behavior

New-ExternalHelp returns this error:

ForEach-Object : Exception calling "NodeModelToMamlModel" with "1" argument(s): "Z:\Host\Desktop\Module-Justin\temp\release\docs\Module-Justin.md:2:(5) '
## Module-Justin Cmdlets
'
 Unexpected header name Module-Justin Cmdlets"
At \\*********\Documents\WindowsPowerShell\Modules\platyPS\0.12.0\platyPS.psm1:1539 char:22
+     $markdownFiles | ForEach-Object {
+                      ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ForEach-Object], MethodInvocationException
    + FullyQualifiedErrorId : HelpSchemaException,Microsoft.PowerShell.Commands.ForEachObjectCommand

Environment data

OS: Windows 10 1803
PowerShell: 5.1.17134.590
PlatyPS: v0.12.0

Metadata

Metadata

Assignees

No one assigned

    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