Partilhar via


RunspaceInvoke.Invoke Method

Definition

Overloads

Invoke(String)

Invoke the specified script

Invoke(String, IEnumerable)

Invoke the specified script and passes specified input to the script

Invoke(String, IEnumerable, IList)

Invoke the specified script and passes specified input to the script.

Invoke(String)

Invoke the specified script

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Invoke(System::String ^ script);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Invoke (string script);
member this.Invoke : string -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Invoke (script As String) As Collection(Of PSObject)

Parameters

script
String

msh script to invoke

Returns

Output of invocation

Applies to

Invoke(String, IEnumerable)

Invoke the specified script and passes specified input to the script

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Invoke(System::String ^ script, System::Collections::IEnumerable ^ input);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Invoke (string script, System.Collections.IEnumerable input);
member this.Invoke : string * System.Collections.IEnumerable -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Invoke (script As String, input As IEnumerable) As Collection(Of PSObject)

Parameters

script
String

msh script to invoke

input
IEnumerable

input to script

Returns

Output of invocation

Applies to

Invoke(String, IEnumerable, IList)

Invoke the specified script and passes specified input to the script.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ Invoke(System::String ^ script, System::Collections::IEnumerable ^ input, [Runtime::InteropServices::Out] System::Collections::IList ^ % errors);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> Invoke (string script, System.Collections.IEnumerable input, out System.Collections.IList errors);
member this.Invoke : string * System.Collections.IEnumerable * IList -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function Invoke (script As String, input As IEnumerable, ByRef errors As IList) As Collection(Of PSObject)

Parameters

script
String

msh script to invoke

input
IEnumerable

input to script

errors
IList

this gets errors from script

Returns

output of invocation

Remarks

errors is the non-terminating error stream from the command. In this release, the objects read from this PipelineReader are PSObjects wrapping ErrorRecords.

Applies to