Skip to content
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

Scoop breaks PSModulePath on installing a psmodule install #2745

Closed
krokofant opened this issue Nov 6, 2018 · 3 comments
Closed

Scoop breaks PSModulePath on installing a psmodule install #2745

krokofant opened this issue Nov 6, 2018 · 3 comments

Comments

@krokofant
Copy link
Contributor

krokofant commented Nov 6, 2018

It removes a part of the default modules path, namely:

C:\Users\***\Documents\WindowsPowerShell\Modules;

After install my module paths are:

C:\Users\***\scoop\modules;;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules\;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\

I've experienced this on two different machines.

This seems to break importing modules from the profile

@krokofant
Copy link
Contributor Author

Or maybe this happens on uninstall. Not sure yet.

@krokofant
Copy link
Contributor Author

krokofant commented Nov 6, 2018

Since the resulting PSModulePath starts with the C:\Users\***\scoop\modules;; I think that this is the User paths and the ;; seems to come from here https://github.com/lukesampson/scoop/blob/757d83036cfb382c004d68f5ddfe981025fba95b/lib/psmodules.ps1#L47-L56

Specifically "$dir;$path". Will try to narrow it down.

@krokofant
Copy link
Contributor Author

krokofant commented Nov 6, 2018

It seems like the C:\Users\***\Documents\WindowsPowerShell\Modules path is prepended when there is no user env variable called PSModulePath but when it exists it does not add the path automatically so when we create the user env variable it excludes the path.

Great implementation Microsoft 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant