views:

99

answers:

1

Hi,

This is executing scripts asynchronously from c# and having threads doing the work of loading the script for execution and waiting for output to come out. I may need to have many scripts executing at once, maybe concurrently.

Is possible to have a 1:M relationship between runspace and pipelines in windows poweshell and if so what are the implications for it. Specifically as regards memory use, if anybody has any experience of this.

Also if their is a way to have more than 1 pipelines per runspace, then would that have a knock on effect from the host.

+2  A: 

If you mean multiple simultaneous pipelines in a single runspace: no.

In fact, the one documented exception that the CreatePipeline methods throw is InvalidRunspaceStateException which happens when "the runspace is not in a state that allows a pipeline to be created" i.e. when the previous pipeline hasn't completed yet.

Jaykul
Hi Jaykul,Well that is a straight answer. Would it be a case of having multiple runspace's then, and checking the pipeline state in one to see if in operation and if so, using the other one, assuming it was available, or perhaps waiting until one was available. Would that ve a viable scenario.
scope_creep