Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactor module version/GUID comparison logic #7125
TLDR: Factors out module GUID/version checking logic to all use the same code path.
This PR routes all of the module GUID/version checking through
Previously the code had a number of 6-line if-conditions and cascading if-elses that all check module versioning in a slightly different way. I've tried to identify the common logic and unify it all.
Breaking Change Summary
Tests for this PR were already added in #7499. This PR just removes the
To make a quality check of this change we are forced to do a lot of tests locally. So it makes sense to start by reviewing and extending the tests in the repo. I see that we don't actually have the tests for this code. I think we could add the new tests in new separate PR and then continue the PR. The
Ah so there is an Import-Module.Tests.ps1? It’s not under /test/powershell/engine/Module like I expected. Where is it?
Yes agreed we should bulk up the tests in another PR to merge before this one. I’ve been thinking about doing that but now I know there’s a test file I will see what we already have...
This is wrong. That test PR skips those tests. This PR should enable them.
EDIT: Tests are now enabled, and pass.