| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Paul Higinbotham (@PaulHigin) would this fix also affect the use of nested iterations of Start-ThreadJob and similar $using: variable usage there? |
Sorry, something went wrong.
…owerShell.cs Co-Authored-By: Ilya <darpa@yandex.ru>
…owerShell.cs Co-Authored-By: Ilya <darpa@yandex.ru>
…owerShell.cs Co-Authored-By: Ilya <darpa@yandex.ru>
…owerShell.cs Co-Authored-By: Ilya <darpa@yandex.ru>
|
Rain Sallow (/u/ta11ow) (@vexx32) No, ThreadJob will also need to change. Please create an issue for it. |
Sorry, something went wrong.
|
Just double checked it, and looks like Start-ThreadJob doesn't exhibit the same issue, interestingly enough. 🎉 |
Sorry, something went wrong.
|
Will this be added to RC3? |
Sorry, something went wrong.
|
Przemysław Kłys (@PrzemyslawKlys) I don't think so, as the RC3 is already locked down and we have a very high bar for GA. But this fix will be included in a servicing release later. |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
What is the status of this PR? |
Sorry, something went wrong.
|
AFAIK there is no reason not to take this PR. Dongbo Wang (@daxian-dbw) can we include this in the next preview release? |
Sorry, something went wrong.
|
Paul Higinbotham (@PaulHigin) Please rebase to pass CIs. |
Sorry, something went wrong.
|
Closing this PR since it is so old, and created a new one (#14548) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This fixes a bug in ForEach-Object -Parallel where a using variable in a nested ForEach-Object -Parallel throws an error even when the variable is defined in the correct scope (Issue #11817).
PR Context
This error was occurring because, when ForEach-Object -Parallel was assembling the user variable map, it was searching all nested scriptblocks within the ForEach scriptblock, with the result of finding nested using variables where the variable had not yet been defined. Since the nested scriptblock using variable had not been defined in the current scope, a mapping error was thrown.
Fix is to change the using variable map function to not search nested scriptblocks in the ForEach -Parallel case. This way foreach -parallel using variable mapping is always performed only for the current scope.
Many thanks to Michael Klement (@mklement0) for pointing out the fix.
PR Checklist