platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

Supress ProgressAction parameter from New-MarkdownHelp output

Open chrisda opened this issue 1 year ago • 2 comments

Summary of the new feature / enhancement

Typically, I run New-MarkdownHelp (v14.2) in PowerShell 5.1x. I recently had occasion to run it in PowerShell 7.4.3. When I did, every cmdlet got a new ProgressAction parameter. According to about_CommonParameters, ProgressAction is a common parameter like Debug or Verbose. Unclear why only that common parameter is getting added to cmdlet articles.

Proposed technical implementation details (optional)

ProgressAction doesn't need to appear in the output of New-MarkdownHelp. This issue might be similar to the AsJob parameter as described in #339 (although AsJob was related to remote PowerShell).

chrisda avatar Jul 18 '24 17:07 chrisda

I tried forking and building from source but was having issues getting it done. Anyways, re:

Unclear why only that common parameter is getting added to cmdlet articles

See:

https://github.com/PowerShell/platyPS/blob/f9fa12821b6dbacdd16cc486b77787cdc51242fa/src/platyPS/platyPS.psm1#L2530-L2547

It's hard coded. Wouldn't something like this be future proof:

if ([System.Management.Automation.PSCmdlet]::CommonParameters.Contains($parameterName) -or
    [System.Management.Automation.PSCmdlet]::OptionalCommonParameters.Contains($parameterName)) {
       return true;
 }

soulshined avatar Jul 24 '24 19:07 soulshined

I believe this is being addressed in this PR I would love to get a new release with this fix.

jdhitsolutions avatar Aug 14 '24 20:08 jdhitsolutions

Thank you for your contribution. We are no longer maintaining the v0.14 version of platyPS. If you’re interested in continuing to help, we’d love your support on the release version of Microsoft.PowerShell.PlatyPS v1.0.0.

sdwheeler avatar Jul 30 '25 15:07 sdwheeler