Comments (13)
Also, after that's done it would make sense to add .psd1 file and publish it to PsGet gallery (and maybe PowerShellGet gallery). .psd1 file would help with versioning (it's the only option to provide a version)
from invoke-parallel.
fyi. This module needs to be dot sourced I believe. I have never had an error while using . Script
while you probably are running into some scope issues with trying to import.
@RamblingCookieMonster I will say I've used both your project and the PoshRSJob. I find your script to be vastly simpler to implement most times. You did a great job on this!
from invoke-parallel.
Agreed - any issue with a mild file re-org?
- \Invoke-Parallel\
- \Invoke-Parallel.psm1
- \Tests\
- \Invoke-Parallel.Tests.ps1
- \AppVeyor-Pester.ps1 (abstracted calls to pester to test PS2 as well, example here)
- \appveyor.yml
- \README.md
- \LICENSE.md
Let me know if you see any issues with this!
from invoke-parallel.
Looks good
from invoke-parallel.
Absolutely!
Running into a strange issue in the Restructure branch. Having moved to a psm1, the ImportVariable Pester tests are now failing to find the user's variables.
Global, Script, Local, 0, 1, and 2 all do not contain variables with name 'a' and 'long'. Running the same code in the pester test works in my local session:
Successful run outside of Pester:
Failed run in Pester (Added temporary verbose output to illustrate what Get-Variable can see)
The Pester test fails when invoked directly on my system as well (i.e. not an issue exclusive to appveyor.pester.ps1).
Will keep tinkering.
from invoke-parallel.
Yeah, I can reproduce this, https://gist.github.com/RamblingCookieMonster/05552112507db8a04246
Learned something about scope and encapsulation!
I'm assuming this might be a mutually exclusive choice between moving to a module, and allowing ImportVariables to work in all scenarios?
Ugly alternative might be to have Invoke-Parallel.psd1, Invoke-Parallel.psm1, which load up Invoke-Parallel.ps1, allowing users to dot source Invoke-Parallel.ps1 outside the module if they want to use that functionality. Would need to vary the scope for the Get-Variable call.
from invoke-parallel.
That's interesting. I don't think it's mutually exclusive. Need to dig into it.
from invoke-parallel.
Sheepish... Created a branch for the changes, committed changes to master. Heading out for caffeine. If it would make sense let me know and I can revert master and roll this in with a merge.
Sorry about that!
from invoke-parallel.
No worries, I think it's fine to make a force push to master in this case.
from invoke-parallel.
How far did you get with this, is there a working module that can be used for executing a script block rather than dot sourcing?
from invoke-parallel.
Nope, unfortunately, I've sort of let this project languish given the excellent PoshRSJob module by Boe. There are a few other issues that I might tackle, but this is pretty low on the priority list given what (I assume) it will take... unless we can just use ScriptsToProcess in the manifest?
If you have any ideas on how to implement this, or code, totally open to pull requests : D
Cheers!
from invoke-parallel.
Import-Modue Invoke-Parallel
$filelist | Invoke-Parallel -ImportVariables -Throttle 10 -ScriptBlock {
...
Get-RunspaceData : You cannot call a method on a null-valued expression.
At C:\Users\ImN1\Documents\WindowsPowerShell\Modules\Invoke-Parallel\Invoke-Parallel.psm1:542 char:13
-
Get-RunspaceData -wait
-
~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (:) [Write-Error], RuntimeException
- FullyQualifiedErrorId : InvokeMethodOnNull,Get-RunspaceData
but
No error by ". \PATH\Invoke-Parallel.ps1"
from invoke-parallel.
What is preventing this from moving forward?
from invoke-parallel.
Related Issues (20)
- NullReferenceException HOT 1
- Physical Memory usage HOT 2
- Log file locks if multiple scripts invoke-parallel HOT 4
- Get-RunspaceData error: Collection was modified; enumeration operation may not execute HOT 1
- it is not working to get AD group member using Get-ADGroupMember HOT 1
- Get-RunspaceData : ERROR: Deployment failed HOT 2
- Invoke-Parallel: When launched within a function, does not carry param()-variables forward
- Invoke-Parallel Scriptblock [Enviornment]::GetEnvironmentVariable
- Using a shared & synchronized variable to hold a counter HOT 2
- How we can use Invoke-Parallel to fetch ADUser data? HOT 4
- Import-Modules in parallel when session profile loaded? HOT 1
- Issue with Get-WMIObject HOT 1
- Weird error running Invoke-Parallel
- Variable Creep HOT 3
- Adding item to external collection HOT 2
- Error A null key is not allowed in a hash literal HOT 1
- skips
- Invoke-Parallel skips processing some objects when throttle > 1 HOT 2
- Fast-Ping Sweep (recommendations or tricks) HOT 2
- $PWD inside the script block doesn't update after changing the current directory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-parallel.