-
-
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
Convert .ps1 to .psm1 #16
Comments
Agreed - any issue with a mild file re-org?
Let me know if you see any issues with this! |
Looks good |
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) |
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. |
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. |
That's interesting. I don't think it's mutually exclusive. Need to dig into it. |
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! |
No worries, I think it's fine to make a force push to master in this case. |
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? |
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! |
Import-Modue Invoke-Parallel
|
fyi. This module needs to be dot sourced I believe. I have never had an error while using @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! |
What is preventing this from moving forward? |
Modules is the preferred way to distribute reusable components.
The text was updated successfully, but these errors were encountered: