Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add -Any parameter to Wait-RSJob, to end wait on first job finishing #183

Open
pvspain opened this issue Jun 2, 2018 · 0 comments

Comments

@pvspain
Copy link

pvspain commented Jun 2, 2018

Do you want to request a feature or report a bug?
I would like to request a new feature

What is the current behavior?
Wait-RSJob currently waits for all $Job/$InputObject to finish before the cmdlet completes execution.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?
Please emulate the behaviour of PowerShell v3+ Wait-Job -Any parameter, which causes the cmdlet to complete execution when the first job in $Job/$InputObject finishes.

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?

Please provide a code example showing the issue, if applicable:

# From: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/wait-job?view=powershell-3.0

$s = New-PSSession (Get-Content Machines.txt)
$c = 'Get-EventLog -LogName System | where {$_.EntryType -eq "error" --and $_.Source -eq "LSASRV"} | Out-File Errors.txt'
Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c}
Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any}
MVKozlov added a commit to MVKozlov/PoshRSJob that referenced this issue May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant