Skip to content

New-ExternalHelp throws error if the module landing page contains a hyphen in the name. #515

Closed
@sdwheeler

Description

@sdwheeler

New-ExternalHelp throws error if the module landing page contains a hyphen in the name.

Steps to reproduce

PS C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v> New-ExternalHelp -Path . -OutputPath . -Verbose

... deleted output ...

VERBOSE: Start processing command Test-VHD
VERBOSE: Reading from 'C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v\Test-VMNetworkAdapter.md' with encoding = Unicode (UTF-8)
VERBOSE: Start processing command Test-VMNetworkAdapter
VERBOSE: Reading from 'C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v\Test-VMReplicationConnection.md' with encoding = Unicode (UTF-8)
VERBOSE: Start processing command Test-VMReplicationConnection
VERBOSE: Reading from 'C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v\Update-VMVersion.md' with encoding = Unicode (UTF-8)
VERBOSE: Start processing command Update-VMVersion
VERBOSE: Writing external help to path '.\Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml'
VERBOSE: Writing to '.\Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml' with encoding: Unicode (UTF-8)

    Directory: C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           4/15/2021  8:02 AM        5510527 Microsoft.HyperV.PowerShell.Cmdlets.dll-Help.xml
VERBOSE: Reading from 'C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v\Hyper-V.md' with encoding = Unicode (UTF-8)
VERBOSE: Start processing command Hyper-V Module
ForEach-Object: C:\Program Files\PowerShell\Modules\platyPS\0.14.1\platyPS.psm1:1565
Line |
1565 |      $markdownFiles | ForEach-Object {
     |                       ~~~~~~~~~~~~~~~~
     | Exception calling "NodeModelToMamlModel" with "1" argument(s):
     | "C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v\Hyper-V.md:4:(181) '  ##
     | Hyper-V Cmdlets  '  Unexpected header name Hyper-V Cmdlets"

The cmdlet goes through all of the cmdlet files and creates the XML file. Then it tries to process Hyper-V.md as a cmdlet instead of a module page.

If I rename the file to HyperV.md the cmdlet completes without error.

Environment data

PS C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

[Thu 08:16:40AM] [sdw-fix-schema +4 ~1 -1 !]
PS C:\Git\Windows\windows-powershell-docs\docset\winserver2022-ps\hyper-v> gmo platyPS

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     0.14.1                platyPS                             {Get-HelpPreview, Get-MarkdownMetadata, Merge-M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions