| PowerShellScriptRunSynchronously 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 Collection<PSObject> RunSynchronously(
string commandText,
ref Runspace runspace,
EventLog log = null,
PSDataCollection<string> input = null,
params KeyValuePair<string, Object>[] parameterList
)
Public 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:
virtual Collection<PSObject^>^ RunSynchronously(
String^ commandText,
Runspace^% runspace,
EventLog^ log = nullptr,
PSDataCollection<String^>^ input = nullptr,
... array<KeyValuePair<String^, Object^>>^ parameterList
) sealed
abstract 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>
override 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.
Implements
IPowerShellScriptRunSynchronously(String, Runspace, EventLog, PSDataCollectionString, KeyValuePairString, Object)See Also