proxb / PoshRSJob

Provides an alternative to PSjobs with greater performance and less overhead to run commands in the background, freeing up the console and allowing throttling on the jobs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing an empty batch to Wait-RSJob stops all further processing in the caller

codykonior opened this issue · comments

This is a bug. Reproduce with an unused batch number such as:

Get-RSJob -Batch "123" | Wait-RSJob; "Hi";

Does not show Hi. All processing in any caller (like a function) stops at this point because the caller exits. It's caused by Line 119 in Wait-RSJob.ps1

        If ($List.count -eq 0) {
            BREAK
        }  

It seems that break here has pretty bad (for me) unintended consequences. Replacing it with a return appears to work better.

@codykonior This should be fixed now, please test and let me know the results.

Yes it's fixed.

1.7.3.6 did the trick.. thanks v much
failed to import direct from gallery, was worried, manual import worked tho..