Udostępnij za pośrednictwem


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(... cli::array <System::Object ^> ^ args);
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 the maximum scope depth has been exceeded

Thrown if a script runtime exceptionexception occurred.

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

Applies to