ScriptBlock.Invoke(Object[]) ScriptBlock.Invoke(Object[]) ScriptBlock.Invoke(Object[]) Method

Definition

Execute this node with the specified arguments. The arguments show up in the script as $args with $_ being the first argument.

public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Invoke (params object[] args);
member this.Invoke : obj[] -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Invoke (ParamArray args As Object()) As Collection(Of PSObject)
Parameters
args
Object[]

The arguments to this script.

Returns

The object(s) generated during the execution of the script block returned as a collection of PSObjects

Exceptions

Thrown if a script runtime exceptionexception occurred

An internal (non-public) exception from a flow control statement

Applies to