Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

PowerShell.AddParameters Method

Definition

Namespace:
System.Management.Automation
Assembly:
System.Management.Automation.dll
Package:
Microsoft.PowerShell.5.1.ReferenceAssemblies v1.0.0
Package:
System.Management.Automation v7.4.15
Package:
System.Management.Automation v7.5.6
Package:
System.Management.Automation v7.6.1

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
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);
public System.Management.Automation.PowerShell AddParameters(System.Collections.IDictionary parameters);
member this.AddParameters : System.Collections.IDictionary -> System.Management.Automation.PowerShell
Public Function AddParameters (parameters As IDictionary) As PowerShell

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.

Applies to

AddParameters(IList)

Adds a set of parameters to the last added command.

public:
 System::Management::Automation::PowerShell ^ AddParameters(System::Collections::IList ^ parameters);
public System.Management.Automation.PowerShell AddParameters(System.Collections.IList parameters);
member this.AddParameters : System.Collections.IList -> System.Management.Automation.PowerShell
Public Function AddParameters (parameters As IList) As PowerShell

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.

Applies to