| PowerShellRunSynchronously Method |
Runs a PowerShell command/script synchronously.
Namespace:
Galactic.PowerShell
Assembly:
Galactic.PowerShell (in Galactic.PowerShell.dll) Version: 1.3.0.499 (1.3.0.499)
Syntax public static Collection<PSObject> RunSynchronously(
string commandText,
ref Runspace runspace,
EventLog log = null,
PSDataCollection<string> input = null,
params KeyValuePair<string, Object>[] parameterList
)
Public Shared Function RunSynchronously (
commandText As String,
ByRef runspace As Runspace,
Optional log As EventLog = Nothing,
Optional input As PSDataCollection(Of String) = Nothing,
ParamArray parameterList As KeyValuePair(Of String, Object)()
) As Collection(Of PSObject)
public:
static Collection<PSObject^>^ RunSynchronously(
String^ commandText,
Runspace^% runspace,
EventLog^ log = nullptr,
PSDataCollection<String^>^ input = nullptr,
... array<KeyValuePair<String^, Object^>>^ parameterList
)
static member RunSynchronously :
commandText : string *
runspace : Runspace byref *
?log : EventLog *
?input : PSDataCollection<string> *
parameterList : KeyValuePair<string, Object>[]
(* Defaults:
let _log = defaultArg log null
let _input = defaultArg input null
*)
-> Collection<PSObject>
Parameters
- commandText
- Type: SystemString
The text of the command to run. - runspace
- Type: Runspace
An open PowerShell Runspace this script will use to invoke its pipeline. - 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. - parameterList
- Type: System.Collections.GenericKeyValuePairString, Object
An array of key/value objects defining additional parameters to supply to the PowerShell script.
Return Value
Type:
CollectionPSObjectA collection of PSObjects that are the result of the script/command run. Null if an error occurred while processing the command / script.
See Also