Skip to content
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

How do run without needing input objects? #28

Closed
artisticcheese opened this issue Apr 17, 2016 · 1 comment
Closed

How do run without needing input objects? #28

artisticcheese opened this issue Apr 17, 2016 · 1 comment

Comments

@artisticcheese
Copy link

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}

@RamblingCookieMonster
Copy link
Owner

RamblingCookieMonster commented Apr 19, 2016

Hi!

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.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants