platyPS
platyPS copied to clipboard
Fix reading/writing syntax parameters in Maml help
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
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:
requiredattribute of<command:parameterValue>should betrue - 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.