PowerShell-Docs icon indicating copy to clipboard operation
PowerShell-Docs copied to clipboard

Error-handling in ForEach Parallel

Open devmanlab opened this issue 6 years ago • 2 comments

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.

devmanlab avatar Apr 13 '20 13:04 devmanlab

@PaulHigin Can you comment?

sdwheeler avatar Apr 13 '20 13:04 sdwheeler

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.

PaulHigin avatar Apr 13 '20 15:04 PaulHigin