Skip to content

Fix #325: Module dependency loading should pick latest module version #326

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

Merged
merged 1 commit into from
Dec 19, 2016

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Dec 19, 2016

This change fixes an issue with the loading of both the PSScriptAnalyzer
and Plaster modules. We were simply using Import-Module without
specifying a version to be loaded. Apparently PowerShell prioritizes the
PSModulePath order over the module version order so there are instances
where an older version of one of these module will be loaded even though a
newer version is available at a different location on the machine.

This change adds extra logic to sort the list of returned modules so that
the latest version of the module is always loaded.

This change fixes an issue with the loading of both the PSScriptAnalyzer
and Plaster modules.  We were simply using Import-Module without
specifying a version to be loaded.  Apparently PowerShell prioritizes the
PSModulePath order over the module version order so there are instances
where an older version of one of these module will be loaded even though a
newer version is available at a different location on the machine.

This change adds extra logic to sort the list of returned modules so that
the latest version of the module is always loaded.
@daviwil daviwil added this to the 0.8.1 milestone Dec 19, 2016
@daviwil
Copy link
Contributor Author

daviwil commented Dec 19, 2016

@rkeithhill any comments or concerns about this manner of loading the latest version of our dependency modules? Within the next couple of "major" releases I'm going to add a "ModuleService" that will allow us to go a little further and ask for a version of the module within a specified range so that we won't pick up major version bumps.

@rkeithhill
Copy link
Contributor

LGTM

@daviwil daviwil merged commit d1ba77b into develop Dec 19, 2016
@daviwil daviwil deleted the daviwil/fix-module-loading branch December 19, 2016 20:12
@daviwil
Copy link
Contributor Author

daviwil commented Dec 19, 2016

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants