PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
778 stars 152 forks source link

Update-MarkdownCommandHelp incorrectly setting SupportsWildcards to false #665

Closed sdwheeler closed 1 week ago

sdwheeler commented 2 months ago

Prerequisites

Steps to reproduce

The existing markdown file has SupportsWildcards: true for the -Path parameter. After update the value is false.

Update-MarkdownCommandHelp -Path ./v2docs/Import-MamlHelp.md

Expected behavior

The parameter metadata should show SupportsWildcards: true for this command.

Actual behavior

The parameter metadata shows SupportsWildcards: false for this command.

Error details

No response

Environment data

Microsoft.PowerShell.PlatyPS v2 branch commit 27d5ffe

Visuals

No response

JamesWTruher commented 2 months ago

@sdwheeler I'm confused, the supportswildcard attribute is on these parameters

> $cmds | %{ [pscustomobject]@{ n = $_; sw = (get-command $_).Parameters['Path'].Attributes.TypeId.Name.where({$_ -match "SupportsWildcards"}) }}

n                         sw
-                         --
Import-MamlHelp           {SupportsWildcardsAttribute}
Import-MarkdownModuleFile {SupportsWildcardsAttribute}
Import-YamlCommandHelp    {SupportsWildcardsAttribute}
Import-YamlModuleFile     {SupportsWildcardsAttribute}
sdwheeler commented 2 months ago

@JamesWTruher I made an incorrect assumption about the attribute. The problem is in Update-MarkdownCommandHelp. I updated the title and description of the issue.

sdwheeler commented 1 week ago

Fixed in OPS13