ScriptBlock.InvokeReturnAsIs(Object[]) Method

Definition

Execute this node with the specified arguments. The arguments show up in the script as $args. This overload return the raw (unwrapped) result so it can be more efficient.

public:
 System::Object ^ InvokeReturnAsIs(... cli::array <System::Object ^> ^ args);

Parameters

args
Object[]

The arguments to pass to this scriptblock.

Returns

The object(s) generated during the execution of the script block. They may or may not be wrapped in PSObject. It's up to the caller to check.

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

Product Versions
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0