You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to hit a website untill I want to stop with 50 threads with various URLs. Right now I have to do 1..1000000 | Invoke-Parallel {} which I assume creates some enormous hashtable, enumerates it etc with none of those things needed. I understand it's needed obviously for progress bar etc but I'd rather have something like below or what is the best way to accomlish it?
while ($true) {Invoke-Parallel}
The text was updated successfully, but these errors were encountered:
Your approach seems about right. An alternative would be to write a script / function around that use case, rather than trying to shoe-horn Invoke-Parallel.
The main issue is that Invoke-Parallel expects you to pass it an input object - even if you pipe these in, it won't start doing anything until it has the full array of items lined up and ready to go.
You might consider @proxb's PoshRSJob - your scenario seems like it could fit into the idea of RSJobs, and you wouldn't need to worry about writing your own runspace handling.
I'm trying to hit a website untill I want to stop with 50 threads with various URLs. Right now I have to do 1..1000000 | Invoke-Parallel {} which I assume creates some enormous hashtable, enumerates it etc with none of those things needed. I understand it's needed obviously for progress bar etc but I'd rather have something like below or what is the best way to accomlish it?
while ($true) {Invoke-Parallel}
The text was updated successfully, but these errors were encountered: