-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
$ErrorActionPreference = "Stop" may have unintended consequences #38
Comments
Do you think this would invoke a similar issue with PoshRSJob module? |
same issue
The first catch works , but invoke-parallel will not go into the second catch block.
I guess also should add ErrorActionPreference check like VerbosePreference check as following , although I don't understand why $VerbosePreference should be checked.
|
i did something like this to try and catch the inner error:
|
This line:
$runspace.powershell.EndInvoke($runspace.Runspace)
Means that if your session is set to stop on errors, and any of your jobs write an error, Invoke-Parallel will error out at the point it is receiving the data.
You might want to evaluate:
This still writes the error but doesn't abort the pipeline; it can also be stored for later when called using something like Invoke-Parallel -ErrorVariable MyErrorList
The text was updated successfully, but these errors were encountered: