Main | Contact | Blog | Documentation

PowerShell Framework

The project dedicated to empowering your PowerShell scripting.

Resolve-PSFDefaultParameterValue

SYNOPSIS

Used to filter and process default parameter values.

SYNTAX

Resolve-PSFDefaultParameterValue [-Reference] <Hashtable> [-CommandName] <String[]> [[-Target] <Hashtable>]
 [[-ParameterName] <String[]>] [<CommonParameters>]

DESCRIPTION

This command picks all the default parameter values from a reference hashtable. It then filters all that match a specified command and binds them to that specific command, narrowing its focus. These get merged into either a new or a specified hashtable and returned.

EXAMPLES

EXAMPLE 1

Resolve-PSFDefaultParameterValue -Reference $global:PSDefaultParameterValues -CommandName 'Invoke-WebRequest'

Returns a hashtable containing all default parameter values in the global scope affecting the command ‘Invoke-WebRequest’.

PARAMETERS

-Reference

The hashtable to pick default parameter values from.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CommandName

The commands to pick default parameter values for.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Target

The target hashtable to merge results into. By default an empty hashtable is used.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: @{ }
Accept pipeline input: False
Accept wildcard characters: False

-ParameterName

Only resolve for specific parameter names.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: *
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Collections.Hashtable

NOTES