Summary: Pass a cluster of parameter values by using an array.
Is there an easy way to write Windows PowerShell commands to handle two separate domains
(for example, production and development) and their credentials?
Define them in an array that contains the parameter names and their values. For example, to pass
the IP address of a domain controller and credentials as a single variable to the Get-ADUser cmdlet:
$DC=”192.168.1.5”
$Cred=(GET-CREDENTIAL)
$CommonParameters=@{‘Server’=$DC;’Credential’=$Cred)
GET-ADUSER –filter * @CommonParameters
Note If you ask a Windows PowerShell person, the popular term for this is “splatting.”