Relevant area(s)
Description of the new feature / enhancement
When a v2 WinGet Configuration file specifies a module dependency (e.g., module: GitDsc with allowPrerelease: true) without pinning a specific version, the WinGet configuration processor should check whether a newer version is available on the PowerShell Gallery and update the cached copy in %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules\.
Current behavior: WinGet caches modules on first use and never updates them, even when no version constraint exists in the configuration file. For example, GitDsc 0.1.3 was cached in November 2024 and remains at that version indefinitely, even though 0.1.6-alpha has been available on the Gallery for months.
Expected behavior: If a configuration file does not specify a module version (i.e., the author intends "use the latest compatible version"), WinGet should update the module to the latest available version before processing. If a version IS pinned, the pinned version should be respected.
Why this matters: Stale modules can contain bugs that have been fixed upstream, miss new resources added in later versions, or behave differently than the module author intends. Users have no obvious indication that their cached modules are outdated, and the only workaround is manually copying newer module versions into WinGet's module path.
Relation to #5029: This is a more targeted version of the request in #5029. Rather than always upgrading all modules unconditionally, this proposes using version constraints (or lack thereof) in the configuration file as the signal for whether to update.
Proposed technical implementation details
- When processing a v2 configuration with a
module: directive:
- If a
moduleVersion: is specified → use that exact version (current behavior, no change)
- If no version is specified → check the PowerShell Gallery for the latest version matching the prerelease preference, and update the cached copy if a newer version is available
- Consider adding a
--force-module-update flag to winget configure for users who want to force-refresh even when a version is pinned
- Consider adding a
--no-module-update flag for air-gapped or offline scenarios where Gallery access isn't available
Relevant area(s)
Description of the new feature / enhancement
When a v2 WinGet Configuration file specifies a module dependency (e.g.,
module: GitDscwithallowPrerelease: true) without pinning a specific version, the WinGet configuration processor should check whether a newer version is available on the PowerShell Gallery and update the cached copy in%LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules\.Current behavior: WinGet caches modules on first use and never updates them, even when no version constraint exists in the configuration file. For example, GitDsc 0.1.3 was cached in November 2024 and remains at that version indefinitely, even though 0.1.6-alpha has been available on the Gallery for months.
Expected behavior: If a configuration file does not specify a module version (i.e., the author intends "use the latest compatible version"), WinGet should update the module to the latest available version before processing. If a version IS pinned, the pinned version should be respected.
Why this matters: Stale modules can contain bugs that have been fixed upstream, miss new resources added in later versions, or behave differently than the module author intends. Users have no obvious indication that their cached modules are outdated, and the only workaround is manually copying newer module versions into WinGet's module path.
Relation to #5029: This is a more targeted version of the request in #5029. Rather than always upgrading all modules unconditionally, this proposes using version constraints (or lack thereof) in the configuration file as the signal for whether to update.
Proposed technical implementation details
module:directive:moduleVersion:is specified → use that exact version (current behavior, no change)--force-module-updateflag towinget configurefor users who want to force-refresh even when a version is pinned--no-module-updateflag for air-gapped or offline scenarios where Gallery access isn't available