RamblingCookieMonster / Invoke-Parallel

Speed up PowerShell with simplified multithreading
MIT License
384 stars 88 forks source link

index out of range, but I can not find which line throw exception #43

Closed 176coding closed 7 years ago

176coding commented 7 years ago
Get-RunspaceData : Index was out of range. Must be non-negative and less than 
the size of the collection.
Parameter name: index
At D:\UtilityTools\Invoke-Parallel.ps1:590 char:29
+                             Get-RunspaceData
+                             ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], ArgumentOutOfRa 
   ngeException
    + FullyQualifiedErrorId : System.ArgumentOutOfRangeException,Get-RunspaceD 
   ata
RamblingCookieMonster commented 7 years ago

Hi!

Can you post the code that lead to this error? Unfortunately, any error in your code will look like it's coming from 'Get-RunspaceData', given how we handle errors. You'll find similar behavior in most runspace tools out there.

More details in the last 3 comments of this issue

A good alternative is to use error handling in your code, and throw specific errors that you can use to figure out what part of the code is causing trouble.

Cheers!