PowerShell.AddParameters Method

Definition

Overloads

AddParameters(IDictionary)

Adds a set of parameters to the last added command.

AddParameters(IList)

Adds a set of parameters to the last added command.

AddParameters(IDictionary)

Adds a set of parameters to the last added command.

public System.Management.Automation.PowerShell AddParameters (System.Collections.IDictionary parameters);
Parameters
parameters
IDictionary

Dictionary of parameters. Each key-value pair corresponds to a parameter name and its value. Keys must strings.

Returns

A PowerShell instance with the items in parameters added to the parameter list of the last command.

Exceptions

The function was given a null argument.

Powershell instance cannot be changed in its current state.

One of the dictionary keys is not a string.

Remarks

This method is not thread safe.

AddParameters(IList)

Adds a set of parameters to the last added command.

public System.Management.Automation.PowerShell AddParameters (System.Collections.IList parameters);
Parameters
parameters
IList

List of parameters.

Returns

A PowerShell instance with the items in parameters added to the parameter list of the last command.

Exceptions

The function was given a null argument.

Powershell instance cannot be changed in its current state.

Remarks

This method is not thread safe.