Skip to content

Set ParameterDefault

github-actions edited this page Jul 4, 2026 · 2 revisions

external help file: ModernConveniences-help.xml Module Name: ModernConveniences online version: schema: 2.0.0

Set-ParameterDefault

SYNOPSIS

Assigns a value to use for the specified cmdlet parameter to use when one is not specified.

SYNTAX

Set-ParameterDefault [-CommandName] <String> [-ParameterName] <String> [-Value] <Object>
 [-SessionState <SessionState>] [-Global] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

EXAMPLE 1

Set-ParameterDefault 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

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

Uses only the SVG namespace for Select-Xml when none are given explicitly.

PARAMETERS

-CommandName

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

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 assign a default value to.

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 assign 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

-SessionState

The SessionState object to use to access the variables.

Type: SessionState
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $ExecutionContext.SessionState.Module.GetVariableFromCallersModule('PSCmdlet')?.Value?.SessionState
Accept pipeline input: False
Accept wildcard characters: False

-Global

Affects the global parameter defaults.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-ProgressAction

{{ Fill ProgressAction Description }}

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 the default value to assign.

OUTPUTS

NOTES

RELATED LINKS

Stop-ThrowError

Get-Command

about_Scopes

Clone this wiki locally