PowerShellTab.InvokeSynchronous Method

Definition

Overloads

Name Description
InvokeSynchronous(String, Boolean, Int32)

Invokes the script synchronously returning the results instead of placing them in the output This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

InvokeSynchronous(String, Boolean)

Invokes the script synchronouslly returning the results instead of placing them in the output By default scripts will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

InvokeSynchronous(ScriptBlock, Boolean)

Invokes the script synchronouslly returning the results instead of placing them in the output By default scripts will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

InvokeSynchronous(String)

Invokes the script synchronouslly returning the results instead of placing them in the output By default, scripts are executed in a local scope and will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

InvokeSynchronous(ScriptBlock)

Invokes the script synchronouslly returning the results instead of placing them in the output By default, scripts are executed in a local scope and will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

InvokeSynchronous(String, Boolean, Int32)

Invokes the script synchronously returning the results instead of placing them in the output This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ InvokeSynchronous(System::String ^ script, bool useNewScope, int millisecondsTimeout);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> InvokeSynchronous(string script, bool useNewScope, int millisecondsTimeout);
member this.InvokeSynchronous : string * bool * int -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function InvokeSynchronous (script As String, useNewScope As Boolean, millisecondsTimeout As Integer) As Collection(Of PSObject)

Parameters

script
String

The script to run.

useNewScope
Boolean

True to use a new scope

millisecondsTimeout
Int32

The number of milliseconds to wait, or a negative value like TimeOut.Infinite to wait indefinitely.

Returns

The results of running the script.

Exceptions

if script is null.

if an script is already running.

For any errors executing the script. If multiple errors are found running the script, only the first will be thrown as an exception.

If millisecondsTimeout have passed and the command has not completed.

Applies to

InvokeSynchronous(String, Boolean)

Invokes the script synchronouslly returning the results instead of placing them in the output By default scripts will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

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

Parameters

script
String

The script to run.

useNewScope
Boolean

True to use a new scope

Returns

The results of running the script.

Exceptions

if script is null.

if an script is already running.

For any errors executing the script. If multiple errors are found running the script, only the first will be thrown as an exception.

If half a second has passed and the command has not completed.

Applies to

InvokeSynchronous(ScriptBlock, Boolean)

Invokes the script synchronouslly returning the results instead of placing them in the output By default scripts will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

public:
 System::Collections::ObjectModel::Collection<System::Management::Automation::PSObject ^> ^ InvokeSynchronous(System::Management::Automation::ScriptBlock ^ script, bool useNewScope);
public System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject> InvokeSynchronous(System.Management.Automation.ScriptBlock script, bool useNewScope);
member this.InvokeSynchronous : System.Management.Automation.ScriptBlock * bool -> System.Collections.ObjectModel.Collection<System.Management.Automation.PSObject>
Public Function InvokeSynchronous (script As ScriptBlock, useNewScope As Boolean) As Collection(Of PSObject)

Parameters

script
ScriptBlock

The script to run.

useNewScope
Boolean

True to use a new scope

Returns

The results of running the script.

Exceptions

if script is null.

if an script is already running.

For any errors executing the script. If multiple errors are found running the script, only the first will be thrown as an exception.

If half a second has passed and the command has not completed.

Applies to

InvokeSynchronous(String)

Invokes the script synchronouslly returning the results instead of placing them in the output By default, scripts are executed in a local scope and will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

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

Parameters

script
String

The script to run.

Returns

The results of running the script.

Exceptions

if script is null.

if an script is already running.

For any errors executing the script. If multiple errors are found running the script, only the first will be thrown as an exception.

If half a second has passed and the command has not completed.

Applies to

InvokeSynchronous(ScriptBlock)

Invokes the script synchronouslly returning the results instead of placing them in the output By default, scripts are executed in a local scope and will time out if they take longer than half a second to run. This method is intended for the quick evaluation of a script, with minimal side effects for applications like a watch window.

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

Parameters

script
ScriptBlock

The script to run.

Returns

The results of running the script.

Exceptions

if script is null.

if an script is already running.

For any errors executing the script. If multiple errors are found running the script, only the first will be thrown as an exception.

If half a second has passed and the command has not completed.

Applies to