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 throws error if the module landing page contains a hyphen in the name. #515

Closed
sdwheeler opened this issue Apr 15, 2021 · 1 comment · Fixed by #542
Closed
Labels
Backport Tag - Backport needed Backport-Complete Tag - Backport work completed Resolution-Duplicate The issue is a duplicate.

Comments

@sdwheeler
Copy link
Collaborator

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
@sdwheeler
Copy link
Collaborator Author

Duplicate of #447

@sdwheeler sdwheeler marked this as a duplicate of #447 May 18, 2021
@theJasonHelmick theJasonHelmick added Issue-Triaged Backport Tag - Backport needed labels Jun 4, 2021
@theJasonHelmick theJasonHelmick added this to the 2.0-Preview2 milestone Jun 4, 2021
@adityapatwardhan adityapatwardhan added the Backport-Complete Tag - Backport work completed label Jul 7, 2021
@sdwheeler sdwheeler added Resolution-Duplicate The issue is a duplicate. and removed duplicate labels Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport Tag - Backport needed Backport-Complete Tag - Backport work completed Resolution-Duplicate The issue is a duplicate.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants