New-DynamicParamDictionary¶
SYNOPSIS¶
Creates a new RuntimeDefinedParameterDictionary
SYNTAX¶
__AllParameterSets¶
New-DynamicParamDictionary [[-ParameterDefinition] <Object>] [<CommonParameters>]
ALIASES¶
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION¶
Creates a new RuntimeDefinedParameterDictionary
EXAMPLES¶
EXAMPLE 1¶
New-DynamicParamDictionary
Returns a new RuntimeDefinedParameterDictionary
EXAMPLE 2¶
New-DynamicParamDictionary -ParameterDefinition $param1, $param2
Outputs:
Key Value
--- -----
Variable System.Management.Automation.RuntimeDefinedParameter
EnvironmentVariable System.Management.Automation.RuntimeDefinedParameter
Returns a new RuntimeDefinedParameterDictionary with the specified parameters.
EXAMPLE 3¶
DynamicParams @( @{ Name = 'Variable' Type = [string] ValidateSet = Get-Variable | Select-Object -ExpandProperty Name }, @{ Name = 'EnvironmentVariable' Type = [string] ValidateSet = Get-ChildItem -Path env: | Select-Object -ExpandProperty Name } )
Outputs:
Key Value
--- -----
Variable System.Management.Automation.RuntimeDefinedParameter
EnvironmentVariable System.Management.Automation.RuntimeDefinedParameter
Returns a new RuntimeDefinedParameterDictionary with the specified parameters.
EXAMPLE 4¶
$params = @( @{ Name = 'Variable' Type = [string] ValidateSet = Get-Variable | Select-Object -ExpandProperty Name }, @{ Name = 'EnvironmentVariable' Type = [string] ValidateSet = Get-ChildItem -Path env: | Select-Object -ExpandProperty Name } ) $params | ForEach-Object { New-DynamicParam @_ } | New-DynamicParamDictionary
Outputs:
Key Value
--- -----
Variable System.Management.Automation.RuntimeDefinedParameter
EnvironmentVariable System.Management.Automation.RuntimeDefinedParameter
Returns a new RuntimeDefinedParameterDictionary with the specified parameters.
PARAMETERS¶
-ParameterDefinition¶
An array of hashtables or RuntimeDefinedParameter objects to add to the dictionary.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters¶
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS¶
System.Object¶
{{ Fill in the Description }}
OUTPUTS¶
System.Management.Automation.RuntimeDefinedParameterDictionary¶
{{ Fill in the Description }}