PoshRSJob icon indicating copy to clipboard operation
PoshRSJob copied to clipboard

Wait-RSJob -any *Feature Request*

Open Kylesagoodname opened this issue 7 years ago • 1 comments

Is there currently a way to wait for the first runspace in a group of runspaces to finish and return that runspace as a variable? PowerShell jobs has the command "Wait-Job -Any" which will return the first Posh job to finish.

It would be useful to have a switch like this for Wait-RSJob so that you may return the first completed runspace, remove it, and spin up a new one, keeping the total parallel runspaces at the max capacity.

Kylesagoodname avatar Jul 07 '17 22:07 Kylesagoodname

The runspacepools are always running at max capacity unless there are no longer any jobs to process. I'll have to look at the PSJob cmdlet and test what you are describing but I thought a similar action was already happening.

proxb avatar Jul 31 '17 22:07 proxb