Partager via


PSMethodInfo.Invoke(Object[]) Method

Definition

Invokes the appropriate method overload for the given arguments and returns its result.

public:
 abstract System::Object ^ Invoke(... cli::array <System::Object ^> ^ arguments);
public abstract object Invoke (params object[] arguments);
abstract member Invoke : obj[] -> obj
Public MustOverride Function Invoke (ParamArray arguments As Object()) As Object

Parameters

arguments
Object[]

Arguments to the method.

Returns

Return value from the method.

Exceptions

If arguments is null.

For problems finding an appropriate method for the arguments.

For exceptions invoking the method. This exception is also thrown for an PSScriptMethod when there is no Runspace to run the script.

Applies to