Closed lipkau closed 6 years ago
I found that Import-Module -Scope Local
does not work as expected.
Edit: Fixed
I think I'm okay with this. Presumably you run your builds in a CI/CD pipeline or a new session, and thus it won't matter if loading a module and removing it pollutes things (e.g. exposes global variables or other global session or other external changes).
Will leave this open until Monday or Tuesday in case anyone has any concerns.
Thanks!
I dismissed this PR for now, as appending the custom path to $env:PSModulePath
does solve my problem.
thanks @markekraus
By importing the target module in a new process (old way), modules with dependencies declared in the manifest where limited.
This change imports the module only into the scope of the function, therefore being able to import additional dependencies and having access to and setup (importing) done in the global scope