PoshRSJob
PoshRSJob copied to clipboard
Wait-RSJob -any *Feature Request*
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.
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.