🪲 [Fix]: Module import no longer fails when a newer Admin version is installed#59
Conversation
…r Admin dependency
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
Updates the Fonts PowerShell module’s Admin dependency constraint so importing the module doesn’t fail when users have a newer Admin version installed (fix for #58).
Changes:
- Replaced
#Requires -ModulesRequiredVersion(exact pin) withModuleVersion(minimum version) for theAdmindependency. - Updated the minimum
Adminversion requirement to1.1.13in the three public functions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/functions/public/Get-Font.ps1 | Updates #Requires to use minimum Admin version via ModuleVersion. |
| src/functions/public/Install-Font.ps1 | Updates #Requires to use minimum Admin version via ModuleVersion. |
| src/functions/public/Uninstall-Font.ps1 | Updates #Requires to use minimum Admin version via ModuleVersion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Copilot Please also add a max version so we can support up to 1.999.999. Leave the minimal version on 1.1.6. |
Agent-Logs-Url: https://github.com/PSModule/Fonts/sessions/a6dd67f0-d679-4410-ac05-c44e544e6f4d Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Implemented in |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
|
✅ New release: PowerShell Gallery - Fonts 1.1.27 |
|
✅ New release: GitHub - Fonts v1.1.27 |
Importing the
Fontsmodule no longer fails when a newer version of theAdmindependency is installed. Previously, the#Requiresdirectives pinned an exact version (RequiredVersion = '1.1.6'), which causedImport-Module Fontsto error out if only a newer version ofAdminwas present. The directives now specify a major-pinned range usingModuleVersionandMaximumVersion, accepting anyAdminversion from1.1.6up to (but not including)2.0.0.Fixed: Module import fails with newer Admin dependency
The three public functions (
Get-Font,Install-Font,Uninstall-Font) usedRequiredVersionin their#Requires -Modulesdirective, demanding an exact version match for theAdminmodule. This causedImport-Module Fontsto fail when only a newer version ofAdminwas installed.The directives now use a major-pinned range —
ModuleVersionsets the minimum acceptable version, andMaximumVersioncaps at1.999.999to prevent a futureAdminv2.0.0 (with potential breaking changes) from being used. Any version ofAdminfrom1.1.6through1.xwill satisfy the requirement.Technical Details
RequiredVersiontoModuleVersion+MaximumVersionin#Requires -Modulesdirective in three files:src/functions/public/Get-Font.ps1src/functions/public/Install-Font.ps1src/functions/public/Uninstall-Font.ps11.1.6(unchanged from the originalRequiredVersionvalue).MaximumVersion = '1.999.999'added to cap at the1.xmajor version range, preventing breakage from a futureAdminv2.0.0.