Repository navigation
Add two-tier version checking to Install-RequiredModule - #13
Merged
thisjustin816 merged 1 commit intoJul 30, 2026
Merged
Conversation
Add two-tier version checking and AcceptLicense parameter Install-RequiredModule now checks Get-InstalledPSResource first (~5ms, native range handling, prerelease support) then falls back to Get-Module -ListAvailable + Test-VersionRange for file-copied modules (AWS zip bundles, pre-baked CI images). This avoids reinstalling modules that arrived by copy while preserving the speed advantage. - New private function Test-VersionRange: implements NuGet range matching for modules Get-Module returns, with defensive parsing (returns false rather than throwing on unreadable bounds). - Install-RequiredModule: two-tier check, new -AcceptLicense parameter for modules requiring license acceptance. - 8 new tests covering two-tier ordering, prerelease handling, and fallback behavior. Total: 19 tests passing. - Revised comments to follow PowerShell standards (explain constraints, not justify choices). @
Test Results206 tests +39 206 ✅ +39 9m 25s ⏱️ -13s Results for commit 0948707. ± Comparison against base commit 225c7fc. This pull request removes 7 and adds 46 tests. Note that renamed tests count towards both. |
SummarySummary
Coveragesrc/Private - 93.8%
src/Public - 93.3%
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@
Summary
Install-RequiredModule now uses a two-tier version-checking strategy:
This avoids reinstalling modules that arrived by copy while preserving the speed advantage of the package-manager check.
@