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.
MIT License
542 stars 87 forks source link

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

Closed codykonior closed 7 years ago

codykonior commented 7 years ago

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.

proxb commented 7 years ago

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

codykonior commented 7 years ago

Yes it's fixed.

nathanmjones commented 7 years ago

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