Adds a dynamic parameter to a script, within a DynamicParam block.
Add-DynamicParam.ps1 [-Name] <String> [[-Type] <Type>] [-Position <Int32>] [-ParameterSetName <String[]>]
[-Alias <String[]>] [-ValidateCount <Int32[]>] [-ValidateDrive <String[]>] [-ValidateLength <Int32[]>]
[-ValidatePattern <String>] [-ValidateRange <Int32[]>] [-ValidateScript <ScriptBlock>]
[-ValidateSet <Object[]>] [-NotNull] [-NotNullOrEmpty] [-TrustedData] [-UserDrive] [-Mandatory]
[-ValueFromPipeline] [-ValueFromPipelineByPropertyName] [-ValueFromRemainingArguments]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DynamicParam { Add-DynamicParam.ps1 Path string -Mandatory; $DynamicParams } Process { Import-Variables.ps1 $PSBoundParameters; ... }
The name of the parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The data type of the parameter.
Type: Type
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The position of the parameter when not specifying the parameter names.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: -2147483648
Accept pipeline input: False
Accept wildcard characters: False
The name of the set of parameters this parameter belongs to.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: __AllParameterSets
Accept pipeline input: False
Accept wildcard characters: False
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The valid number of values for a parameter that accepts a collection. A range can be specified with a list of two integers.
Type: Int32[]
Parameter Sets: (All)
Aliases: Count
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Valid root drive(s) for parameters that accept paths.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The valid length for a string parameter. A range can be specified with a list of two integers.
Type: Int32[]
Parameter Sets: (All)
Aliases: Length
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The valid regular expression pattern to match for a string parameter.
Type: String
Parameter Sets: (All)
Aliases: Match, Pattern
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The valid range of values for a numeric parameter.
Type: Int32[]
Parameter Sets: (All)
Aliases: Range
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A script block to validate a parameter’s value. Any true result will validate the value, any false result will reject it.
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A set of valid values for the parameter. This will enable tab-completion.
Type: Object[]
Parameter Sets: (All)
Aliases: Values
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Requires parameter to be non-null.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Requires parameter to be non-null and non-empty.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Requires the parameter value to be Trusted data.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Requires a path parameter to be on a User drive.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Indicates a required parameter.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: Required
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Indicates a parameter that can accept values from the pipeline.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: Pipeline
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Indicates a parameter that can accept values from the pipeline by matching the property name of pipeline objects to the parameter name or alias.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: PipelineProperties, PipeName
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: RemainingArgs
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.