PowerShell.AddCommand Method

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Adds a cmdlet to the end of the pipeline of the PowerShell object. The variants of this method can add the command with or without specifying that the command should be run within a new local scope. This method is introduced in Windows PowerShell 2.0.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

NameDescription
System_CAPS_pubmethodAddCommand(CommandInfo)

Adds a cmdlet to the end of the pipeline of the PowerShell object by specifying a CommandInfo object. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodAddCommand(String)

Adds a command to the end of the pipeline of the PowerShell object by specifying the command name. This method is introduced in Windows PowerShell 2.0.

System_CAPS_pubmethodAddCommand(String, Boolean)

Adds a cmdlet to the end of the pipeline of the PowerShell object, and specifies whether the cmdlet should be run within a new local scope. This method is introduced in Windows PowerShell 2.0.

Return to top

Community Additions

ADD
Show: