Skip to content

handle installation scope for PowerShell modules#5114

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/powershell-scope-per-operation
Jul 16, 2026
Merged

handle installation scope for PowerShell modules#5114
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/powershell-scope-per-operation

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request refines how custom installation scopes are handled for PowerShell and PowerShell 7 package managers, ensuring that scope selection is correctly applied only when supported and that user-selected scopes override auto-detected ones. It also adds comprehensive regression tests to prevent future issues related to scope handling.

Improvements to scope handling logic:

  • Updated ManagerCapabilities to introduce SupportsCustomScopesOnUpdate and SupportsCustomScopesOnUninstall, allowing more granular control over when custom scopes are available for different operations (Install, Update, Uninstall).
  • Modified PowerShell and PowerShell 7 manager capability definitions to correctly set these new flags, reflecting that only install operations support custom scopes for PowerShell, and only install/uninstall as appropriate for PowerShell 7.
  • Refined logic in ApplyProfileEnableState to enable or disable scope selection based on these new capability flags and the current operation type.

Command parameter generation fixes:

  • Changed parameter generation in both PowerShell and PowerShell 7 helpers so that an explicitly chosen scope in the options dialog always overrides the detected scope, and scope parameters are only emitted when supported by the operation type.
    Regression and behavior tests:

  • Added targeted tests to ensure scope selection logic works as intended, including cases where explicit scopes override detected scopes, and that scope parameters are omitted when not supported. Also verifies the new capability flags.
    These changes ensure more predictable and correct behavior for package installation, update, and uninstall operations across supported PowerShell environments.

@GabrielDuf Gabriel Dufresne (GabrielDuf) changed the title handle installation scope for PowerShell modules and disabled the settings for powershell 5.x handle installation scope for PowerShell modules Jul 16, 2026
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit fce15a3 into main Jul 16, 2026
5 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/powershell-scope-per-operation branch July 16, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] UniGetUI doesn't respect the "Installation scope" for PowerShell modules (continued)

2 participants