When a parameter belongs to multiple parameter sets, the current version of PlatyPS creates multiple YAML blocks when the parameter has different metadata in different parameter sets.
For example, a parameter can be required in one set and optional in another. Rather than have separate YAML blocks, create a single YAML block with the aggregated information.
Here is an example from Invoke-Command for -ApplicationName:
Type: System.String
Parameter Sets: FilePathComputerName, ComputerName
Aliases:
Required: False
Position: Named
Default value: $PSSessionApplicationName if set on the local computer, otherwise WSMAN
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The Parameters Sets: metadata should list all sets that the parameter belongs to. The Required: metdata should list the sets where is is true and where it is false. If it is true or false for all sets in Parameter sets: then just list the boolean value.
Also note that Accept pipeline input: should list the type of pipeline input (ByValue or ByPropertyName).
Summary of the new feature / enhancement
When a parameter belongs to multiple parameter sets, the current version of PlatyPS creates multiple YAML blocks when the parameter has different metadata in different parameter sets.
For example, a parameter can be required in one set and optional in another. Rather than have separate YAML blocks, create a single YAML block with the aggregated information.
Here is an example from
Invoke-Command
for-ApplicationName
:Here is an example for
-Credential
The
Parameters Sets:
metadata should list all sets that the parameter belongs to. TheRequired:
metdata should list the sets where is is true and where it is false. If it is true or false for all sets inParameter sets:
then just list the boolean value.Also note that
Accept pipeline input:
should list the type of pipeline input (ByValue or ByPropertyName).Proposed technical implementation details (optional)
No response