Click or drag to resize
Galactic API

PowerShellRunAsynchronously Method

Runs a PowerShell command/script asynchronously.

Namespace:  Galactic.PowerShell
Assembly:  Galactic.PowerShell (in Galactic.PowerShell.dll) Version: 1.3.0.499 (1.3.0.499)
Syntax
public static WaitHandle RunAsynchronously(
	string commandText,
	ref RunspacePool pool,
	PowerShellProcessResults callback,
	EventLog log = null,
	PSDataCollection<string> input = null,
	Dictionary<string, Object> stateValues = null,
	params KeyValuePair<string, Object>[] parameterList
)

Parameters

commandText
Type: SystemString
The text of the command to run.
pool
Type: RunspacePool
An open PowerShell Runspace pool this script will use to invoke its pipeline.
callback
Type: Galactic.PowerShellPowerShellProcessResults
The callback function used to process the results of the asynchronous run.
log (Optional)
Type: Galactic.EventLogEventLog
[Optional] The event log to log execptions to. May be null for no logging.
input (Optional)
Type: PSDataCollectionString
[Optional] A collection of strings representing command-line input sent to the script during execution.
stateValues (Optional)
Type: System.Collections.GenericDictionaryString, Object
[Optional] A collection of named state values that should be passed through the invocation to the callback function.
parameterList
Type: System.Collections.GenericKeyValuePairString, Object
An array of key/value objects defining additional parameters to supply to the PowerShell script.

Return Value

Type: WaitHandle
An WaitHandle object that can be used to determine when the scrip has completed execution. Null if an error occurred while processing the command / script.
See Also