Skip to content

Add -Force and -SkipDependencyCheck to Install-RequiredModule - #12

Merged
thisjustin816 merged 1 commit into
mainfrom
feature/install-required-module-force
Jul 29, 2026
Merged

thisjustin816 merged 1 commit into
mainfrom
feature/install-required-module-force

Conversation

@thisjustin816

@thisjustin816 thisjustin816 commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Add -Force and -SkipDependencyCheck to Install-RequiredModule

These parameters let callers that pin exact versions avoid hand-rolling
their own installer around Install-PSResource. Without them, anyone
needing to reinstall a satisfied pin or skip dependency resolution for
a matched-set family has to bypass this function entirely.

-Force bypasses the installed-version check rather than consulting and
overriding it — the point is "I don't trust what's on disk," and it's
enforced by tests asserting Get-InstalledPSResource is called zero times.
It maps to Install-PSResource's -Reinstall.

-SkipDependencyCheck is forwarded through for families that pin themselves
as a matched set, where resolving each member's dependency graph is slow
and adds nothing.

Also clarify that a bare -Version is the *required* version here, not a
minimum — PSResourceGet deliberately departs from NuGet's table. Add .LINK
references to both NuGet versioning documentation and Install-PSResource,
so readers have anchors rather than assumptions.

- Add -Force, mapping to -Reinstall and skipping the installed check
- Add -SkipDependencyCheck, forwarded through
- Document the PSResourceGet/NuGet deviation in help
- Add .LINK references to Microsoft Learn docs
- Add 5 new tests covering both switches, defaults, and WhatIf interactions
- Bump to 1.5.0 (additive release)
@github-actions

Copy link
Copy Markdown

Test Results

167 tests  +5   167 ✅ +5   9m 19s ⏱️ + 1m 0s
 55 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f9a2c08. ± Comparison against base commit 195c52f.

This pull request removes 7 and adds 12 tests. Note that renamed tests count towards both.
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("    message","MutedDetail","DarkGray")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("    message","UsageStep",null)
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message","ActionDetail","Gray")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message","Detail","Gray")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message","Usage",null)
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("message","Default",null)
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("message","SubHeader","DarkCyan")
Install-RequiredModule.should forward SkipDependencyCheck when asked
Install-RequiredModule.should install over a satisfying version when Force is used
Install-RequiredModule.should not ask for a reinstall unless Force is used
Install-RequiredModule.should omit SkipDependencyCheck by default
Install-RequiredModule.should still honor WhatIf with Force
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("    message","DarkGray","MutedDetail")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("    message",null,"UsageStep")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message","Gray","ActionDetail")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message","Gray","Detail")
Unit Tests.-Intent parameter set.should preserve compound compatibility intents("  message",null,"Usage")
…

@github-actions

Copy link
Copy Markdown

Summary

Summary
Generated on: 7/29/2026 - 11:13:42 PM
Coverage date: 7/29/2026 - 11:03:02 PM
Parser: JaCoCo
Assemblies: 2
Classes: 32
Files: 32
Line coverage: 93.1% (540 of 580)
Covered lines: 540
Uncovered lines: 40
Coverable lines: 580
Total lines: 2127
Covered branches: 0
Total branches: 0
Method coverage: Feature is only available for sponsors
Tag: 42_30498200277

Coverage

src/Private - 80%
Name Line Branch
src/Private 80% ****
src/Private/Get-UsernameSID 100%
src/Private/Invoke-Timeout 75%
src/Public - 93.4%
Name Line Branch
src/Public 93.4% ****
src/Public/Add-AzPipelinesPathEntry 100%
src/Public/ConvertFrom-EncryptedSecureString 100%
src/Public/ConvertTo-Psd1 100%
src/Public/Enable-Tls12 100%
src/Public/Export-Screenshot 100%
src/Public/Get-EnvironmentVariable 100%
src/Public/Get-PatPSCredential 100%
src/Public/Get-PSVersion 100%
src/Public/Get-TempDirectory 100%
src/Public/Initialize-GitConfig 100%
src/Public/Install-NugetCLI 100%
src/Public/Install-RequiredModule 100%
src/Public/Reset-ConsoleColor 100%
src/Public/Set-EnvironmentVariable 100%
src/Public/Set-JsonFile 100%
src/Public/Show-ConsoleColor 100%
src/Public/Start-CliProcess 87.8%
src/Public/Start-StopWatch 100%
src/Public/Start-Timeout 100%
src/Public/Stop-DevProcess 96.2%
src/Public/Stop-ProcessTree 100%
src/Public/Stop-Stopwatch 100%
src/Public/Test-CommandAvailable 100%
src/Public/Test-IsAdmin 100%
src/Public/Test-IsFileLocked 0%
src/Public/Test-IsNonInteractiveShell 0%
src/Public/Test-PSEnvironment 100%
src/Public/Uninstall-ProgramByName 92.1%
src/Public/Write-ConsoleMessage 94.8%
src/Public/Write-ProgressToHost 100%

@thisjustin816
thisjustin816 merged commit 225c7fc into main Jul 29, 2026
4 checks passed
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.

1 participant