Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Uninstall dependent module fails even when newer version is available

Aperta
#1,922 2 commenti 1 reazione 3 assegnatari Vedi su GitHub

@SydneyhSmith ci sta già lavorando.

Dal 1/9/2026.

  • #2021 di @copilot-swe-agent — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Area-Uninstall Issue-Bug Needs-Attention :wave:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.
Steps to reproduce

Installed modules:

  • dbatools 2.7.13, which has a dependency requirement for dbatools.library with minversion = 2025.11.29.0, no max version
  • dbatools.library 2025.11.29 and 2025.12.4

Trying to uninstall dbatools.library version 2025.11.29 fails with a dependency check, even though a newer version is installed.

Expected behavior
The dependent module version is uninstalled because a newer version is installed which also fulfills the dependency requirement
Actual behavior
Get-PSResource dbatools* -Scope AllUsers

Name             Version    Prerelease Repository Description
----             -------    ---------- ---------- -----------
dbatools         2.7.13                PSGallery  The community module that enables SQL Server Pros to automate database development and server administration
dbatools.library 2025.12.4             PSGallery  The library that powers dbatools, the community module for SQL Server Pros
dbatools.library 2025.11.29            PSGallery  The library that powers dbatools, the community module for SQL Server Pros

Uninstall-PSResource -Name dbatools.library -Version 2025.11.29 -Scope AllUsers
Uninstall-PSResource: Cannot uninstall version '2025.11.29' of 'dbatools.library'. This package is a dependency for: 'dbatools, dbatools'. If you would still like to uninstall, re-run the command with -SkipDependencyCheck.
Error details
get-error

Exception             :
    Type        : System.Management.Automation.PSInvalidOperationException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Cannot uninstall version '2025.11.29' of 'dbatools.library'. This package is a dependency for: 'dbatools, dbatools'. If you would still like to uninstall, re-run the command with -SkipDependencyCheck.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    Message     : Cannot uninstall version '2025.11.29' of 'dbatools.library'. This package is a dependency for: 'dbatools, dbatools'. If you would still like to uninstall, re-run the command with -SkipDependencyCheck.
    HResult     : -2146233079
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.UninstallPSResource
CategoryInfo          : InvalidOperation: (Microsoft.PowerShel…UninstallPSResource:UninstallPSResource) [Uninstall-PSResource], PSInvalidOperationException
FullyQualifiedErrorId : UninstallPSResourcePackageIsADependency,Microsoft.PowerShell.PSResourceGet.Cmdlets.UninstallPSResource
InvocationInfo        :
    MyCommand        : Uninstall-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 5
    Line             : Uninstall-PSResource -Name dbatools.library -Version 2025.11.29 -Scope AllUsers
    Statement        : Uninstall-PSResource -Name dbatools.library -Version 2025.11.29 -Scope AllUsers
    PositionMessage  : At line:1 char:1
                       + Uninstall-PSResource -Name dbatools.library -Version 2025.11.29 -Scop …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Uninstall-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
      0
      1
Environment data
Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.1                 Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository…}

Key   : PSVersion
Value : 7.5.4
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.5.4
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.20348
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion
Visuals

No response

Lingua principale
C#
Stelle
576
Fork
114
Merge medio
23h 17m
PR unite (30g)
8

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSResourceGet

Tutte le issue di PowerShell/PSResourceGet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.