platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

Fix reading/writing syntax parameters in Maml help

Open teramako opened this issue 3 months ago • 1 comments

PR Summary

This patch fixes a problem with reading and writing syntax parameters in the Maml help.

Fix following issues:

  • https://github.com/PowerShell/platyPS/issues/815
  • https://github.com/PowerShell/platyPS/issues/816
  • Problem with alphabetical order of parameters when generating Maml help (The order of syntax parameters should be: positional parameters, required parameters, others in that order.)

Additionaly, removed no longer needed codes.

PR Context

To fix following issues:

  • https://github.com/PowerShell/platyPS/issues/815
  • https://github.com/PowerShell/platyPS/issues/816

teramako avatar Sep 10 '25 15:09 teramako

Update 2025-09-14

New features:

  • Add <dev:type> in <command:parameterValue> for Maml help generation. In order to be able to read the parameter type from the Maml reader.
  • Assign alias values for parameter in MAML help generation
  • Render accepted values in generating Maml help.

Bug fixes:

  • Don't render <command:parameterValue> if the parameter is SwitchParameter. This fixes a problem that the syntax parameter have been outputed as [-Flag <SwitchParamerter>] instead of [-Flag]
  • Fix: required attribute of <command:parameterValue> should be true
  • Fix: a problem in which HasCmdletBinding of CommandHelp and HasCmdletBinding of each SytanxItem were out of sync when loading Maml Help. This will cause [<CommonParameters>] to be missing from the end of the syntax when exported.

teramako avatar Sep 14 '25 15:09 teramako