Summary of the new feature / enhancement
As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability.
Dynamic Parameters are needlessly difficult to construct.
The shortest possible constructor is:
[Management.Automation.RuntimeDefinedParameter]::new("A", [psobject], @())
and it fails in an entreatingly confusing way, informing me that I could not bind "A" to "AllParameterSets", without telling me why.
Dynamic Parameters should be easier to construct.
The need goes beyond simplifying existing implementation and fixing its buggier parts:
A very common scenario is exposing dynamic parameters from one command to another.
This should also be easier to construct
Proposed technical implementation details (optional)
Summary of the new feature / enhancement
As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability.
Dynamic Parameters are needlessly difficult to construct.
The shortest possible constructor is:
and it fails in an entreatingly confusing way, informing me that I could not bind "A" to "AllParameterSets", without telling me why.
Dynamic Parameters should be easier to construct.
The need goes beyond simplifying existing implementation and fixing its buggier parts:
A very common scenario is exposing dynamic parameters from one command to another.
This should also be easier to construct
Proposed technical implementation details (optional)
[Management.Automation.RuntimeDefinedParameter][PSObject]parameter that acceptsValueFromPipelineByPropertyName[Parameter()]attribute[Management.Automation.RuntimeDefinedParameter]to be coerced from[Management.Automation.ParameterMetadata][Management.Automation.RuntimeDefinedParameter][Management.Automation.RuntimeDefinedParameterDictionary][DynamicParameter],[DynamicParameters], so that less typing is required to create them.