-
-
Notifications
You must be signed in to change notification settings - Fork 88
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 can we share variable state? #20
Comments
Any idea if this will be implemented? I'm interested in being able to collect data from all runspaces in a single object, and then do something with that object when all runspaces complete. |
Hi! Unfortunately, the command is already going a bit overboard with parameters - rather than throw everything into You can still do this though. By design, you can simply do: $whatever = 1..100 | invoke-parallel {
# Some silly example
[pscustomobject]@{
ComputerName = "Server$_"
Blah = 1
}
} If you run into issues with certain items freezing, would could skip items that time out On top of this, the two links from the issue still work pretty well if you want to play around with them. Cheers! |
Closing this out for now. If folks have more ideas on this that wouldn't clutter the parameters too much, I'd be open to it. Cheers! |
Had a question from another medium, boiled down to the lack of shared state (variables).
Will look into implementing something along the lines of Boe's synchronized hash table idea, or Dave Wyatt's Lock-Object.
The text was updated successfully, but these errors were encountered: