Uninstall dependent module fails even when newer version is available
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/PSResourceGet
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PowerShell/PSResourceGet#2056 ·
-
feature_request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PowerShell/PSResourceGet#2013 · 3 commenti ·
-
feature_request Needs-Triage
PowerShell/PSResourceGet#2057 · 1 assegnatario ·
-
Needs-Triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PowerShell/PSResourceGet#2055 ·
-
Needs-Triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
PowerShell/PSResourceGet#2054 ·
Tutte le issue di PowerShell/PSResourceGet
Issue simili
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
LuckyPennySoftware/AutoMapper#4660 ·