Open doesitscript opened 6 years ago
Hiyo!
I'd be up for adjusting this - ideally only if the action is install
or import
. Open to persuasion, but I'd expect the test
action to be read-only and not change the environment, so maybe a logic gate on install or import?
Cheers!
The combination of AddToPath and $Existing being true causes issues when psdepend runs more than once. It looks like $Existing returns out of the script and if $PSDependAction does not contain 'Import', the module will not become available to the session For example, the first run adds the modules to the path as intended:
The following line will not run after the first run: https://github.com/RamblingCookieMonster/PSDepend/blob/264537471ca99e0f53a1145322295aa4da77474d/PSDepend/PSDependScripts/PSGalleryModule.ps1#L186
Currently I've moved the AddToPath code to occur after determining scope and things seem to work. Any thoughts on this?