PowerShell Version 3 introduces the concept of Default Parameter Values.

This allows you to specify a value for one or more parameters for one or more commands.

To implement this, you need to populate a new hashtable – $PSDefaultParameterValues

That Description is Not Helpful

Let’s look at some examples -

First off, we can specify the value for a parameter for a specific command.  The pattern used for the hashtable entries is “NameOfCommand:NameOfParameter” = “ValueOfParameter”.

(I’m stealing some of these examples from the samples provided in CTP1.)

$PSDefaultParameterValues = @{"Get-Process:Name"="powershell"}

Get-Process

Get-Process e*

With that set, every time we run Get-Process and do not specify the Name parameter, the PowerShell runtime will stick “powershell” in for that value.  A specified parameter will always override a default value.



Let’s go the other way and, instead of specifying one command, set a parameter value on all commands (that have that parameter.
This would provide your $cred to any Credential parameter.



We can also use wildcards to match multiple commands.
This would provide a default value to the Server parameter for any command whose noun started with AD (like everything in the ActiveDirectory module.



Since this is a hashtable, it can hold many different mappings - 
To turn off DefaultParameterValues (without removing everything you have set up), you can set a key “Disabled” equal to $true.