$psDefaultParameterValues
allows to define default values with which cmdlet parameters are assigned when a given cmdlet is invoked. $psDefaultParameterValues
is a hash table (or more accurately an instance of System.Management.Automation.DefaultParameterDictionary
). Such a hash table allows to store key/value pairs. $psDefaultParameterValues
customize cmdLets and advanced functions only, but not scripts or simple functions. $psDefaultParameterValues
has no default values. Typically, the values for the $psDefaultParameterValues
variable are set in the profile (see $profile
). $psDefaultParameterValues
is cmdletName:parameterName
. cmdletName
and parameterName
can contain wildcard characters. *:encoding
to utf8
will cause the parameter -encoding
to be set to utf8
when invoking any cmdlet with an -encoding
parameter: $psDefaultParameterValues['*:encoding'] = 'utf8'
$psDefaultParameterValues
can be temporarily disabled by adding a key whose name is Disabled
and a value whose value is $true
. $false
enables using of $psDefaultParameterValues
again.