-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.
Description
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)
- Add simplified constructors to
[Management.Automation.RuntimeDefinedParameter]- Constructing from only a name should create a
[PSObject]parameter that acceptsValueFromPipelineByPropertyName - Constructing from a name and a type should add an empty
[Parameter()]attribute
- Constructing from only a name should create a
- Allow
[Management.Automation.RuntimeDefinedParameter]to be coerced from[Management.Automation.ParameterMetadata] - Create extension methods to assist in custom conversion to
[Management.Automation.RuntimeDefinedParameter] - Enable adding dictionaries to
[Management.Automation.RuntimeDefinedParameterDictionary] - Adding type accelerators
[DynamicParameter],[DynamicParameters], so that less typing is required to create them.
jhoneill, RH-TLagrone and dkattan
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.