-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Couldn't something like this fix the success check (it is language invariant), :
public (ICollection<PSObject> result, Boolean success) Execute(String scriptFullPath, ICollection<CommandParameter> parameters, Boolean ignoreErrorStream = false)
{
String script = _embededFileReader.Read(scriptFullPath);
using (Runspace runspace = RunspaceFactory.CreateRunspace())
{
runspace.Open();
using (Pipeline pipeline = runspace.CreatePipeline())
{
pipeline.Commands.Add(CreateCommand(parameters, script));
Collection<PSObject> results = pipeline.Invoke();
if (!ignoreErrorStream)
{
ThrowFromErrorStream(pipeline);
}
return (results, !pipeline.HadErrors);
}
}
}