What I end up doing for a lot of my scripts are the following:
* Create a sub folder called modules which contains all the modules I want the script to run.
* At the top of my script I have $env:PSModulePath += ";$PSScriptRoot\Modules" to allow me to import them.
What would be really awesome is to have these modules embedded in an exe created from the script.
Also be awesome if they would support intellisense.
In case you are wondering why I need to do this my use case is as follows:
* I have lots of customers who are on different domains so I can't use a central module repository.
* I can't guarantee the state of modules on the machine and other admins might install different versions or rebuild the machine. So I need my scripts to work off an isolated version of their modules.
Support for relative modules
Forum rules
Do not post any licensing information in this forum.
Do not post any licensing information in this forum.
Re: Support for relative modules
Have you tried using the MSI builder for include the modules with the packaged executable?
You can use the staging folder in the MSI settings:
As of now our PrimalSense works off a cache. If the modules are included in the PSModulePath, the cache builder should be able to detect the module and cache the version information.
Adding the ability to cache a module outside of the PSModulePath is on our wish list.
David
You can use the staging folder in the MSI settings:
As of now our PrimalSense works off a cache. If the modules are included in the PSModulePath, the cache builder should be able to detect the module and cache the version information.
Adding the ability to cache a module outside of the PSModulePath is on our wish list.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.