Error-handling in ForEach Parallel
Hello,
I am processing large amount of Graph calls using powershell script block - 500K in my case. I want to process script blocks in batches. If something goes wrong I want to be able to save the data processed by each individual script block. I am planning to use Trap for this purpose. It would be nice to add some documentation how Trap will work inside parallel foreach-object.
Thank you!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 3965609b-1dd4-67db-af26-9f4a77fdabf7
- Version Independent ID: 7ba53b91-ed64-cc24-0cf0-a5dc3f3dc9d0
- Content: ForEach-Object (Microsoft.PowerShell.Core)
- Content Source: reference/7.0/Microsoft.PowerShell.Core/ForEach-Object.md
- Product: powershell
- GitHub Login: @SteveL-MSFT
- Microsoft Alias: slee
@PaulHigin Can you comment?
I think it is an excellent idea to have documentation about dealing with errors in general within foreach-object -parallel. I would re-title this as a request for documentation about error handling in foreach-object -parallel.