scripts

Add-ParameterDefault.ps1

SYNOPSIS

Appends or creates a value to use for the specified cmdlet parameter to use when one is not specified.

SYNTAX

Add-ParameterDefault.ps1 [-CommandName] <String> [-ParameterName] <String> [-Value] <Object> [-Scope <String>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

EXAMPLES

EXAMPLE 1

Add-ParameterDefault.ps1 epcsv nti $true -Scope Global

Establishes that the -NoTypeInformation param of the Export-Csv cmdlet will be true if not otherwise specified, globally for the PowerShell session.

EXAMPLE 2

Add-ParameterDefault.ps1 Select-Xml Namespace @{svg = 'http://www.w3.org/2000/svg'}

Adds the SVG namespace to any existing namespaces used by Select-Xml when none are given explicitly.

PARAMETERS

-CommandName

The name of a cmdlet, function, script, or alias to include a default parameter value for.

Type: String
Parameter Sets: (All)
Aliases: CmdletName

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

-ParameterName

The name or alias of the parameter to include a default value for.

Type: String
Parameter Sets: (All)
Aliases:

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

-Value

The value to include as a default.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Scope

The scope of this default.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Local
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
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

System.Object containing a default value to include.

OUTPUTS

NOTES

Add-ScopeLevel.ps1

Stop-ThrowError.ps1

Get-Command

about_Scopes