Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
justin-p opened this issue Mar 7, 2019 · 1 comment · Fixed by #542 · May be fixed by #456
Closed

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

justin-p opened this issue Mar 7, 2019 · 1 comment · Fixed by #542 · May be fixed by #456

Comments

@justin-p
Copy link

justin-p commented Mar 7, 2019

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

@vors
Copy link
Collaborator

vors commented Mar 7, 2019

Yeah, I think we use a crappy heuristic to distinguish the module help from the individual cmdlets help. Perhaps passing the explicit -ModulePage parameter would solve it for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants