You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
I have a module that is dependent on version 5.4.0 of the Microsoft Teams module.
Uninstalling version 5.3.0 of the Teams module fails, giving a dependency error.
I can uninstall by using the -Force parameter; however that should not be necessary since the older Teams module is outside the dependency scope.
I would expect the Teams module to be uninstalled correctly.PS> Uninstall-Module -Name MicrosoftTeams -RequiredVersion 5.3.0PS>
Actual behavior
PS> Uninstall-Module -Name MicrosoftTeams -RequiredVersion 5.3.0Uninstall-Package: The module 'MicrosoftTeams' of version '5.3.0' in module base folder 'C:\Program Files\PowerShell\Modules\MicrosoftTeams\5.3.0' cannot be uninstalled, because one or more other modules'MyModule' are dependent on this module. Uninstall the modules that depend on this module before uninstalling module 'MicrosoftTeams'.
Error details
PS> Get-ErrorException : Type : System.Exception Message : The module 'MicrosoftTeams' of version '5.3.0' in module base folder 'C:\Program Files\PowerShell\Modules\MicrosoftTeams\5.3.0' cannot be uninstalled, because one or more other modules 'MyModule' are dependent on this module. Uninstall the modules that depend on this module before uninstalling module 'MicrosoftTeams'. HResult : -2146233088TargetObject : Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackageCategoryInfo : InvalidOperation: (Microsoft.PowerShel…ts.UninstallPackage:UninstallPackage) [Uninstall-Package], ExceptionFullyQualifiedErrorId : UnableToUninstallAsOtherModulesNeedThisModule,Uninstall-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackageInvocationInfo : MyCommand : Uninstall-Package ScriptLineNumber : 12733 OffsetInLine : 21 HistoryId : 38 ScriptName : C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1 Line : $null = PackageManagement\Uninstall-Package @PSBoundParameters PositionMessage : At C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:12733 char:21 + … $null = PackageManagement\Uninstall-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : C:\program files\powershell\7\Modules\PowerShellGet PSCommandPath : C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1 InvocationName : PackageManagement\Uninstall-Package CommandOrigin : InternalScriptStackTrace : at Uninstall-Module<Process>, C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1: line 12733 at <ScriptBlock>, <No file>: line 1PipelineIterationInfo :
Environment data
PS>$PSVersionTable
Name Value
---------
PSVersion 7.3.7
PSEdition Core
GitCommitId 7.3.7
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
2.2.5
Visuals
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Steps to reproduce
I have a module that is dependent on version 5.4.0 of the Microsoft Teams module.
Uninstalling version 5.3.0 of the Teams module fails, giving a dependency error.
I can uninstall by using the -Force parameter; however that should not be necessary since the older Teams module is outside the dependency scope.
Some further details:
MyModule.psd1 has the following section:
Expected behavior
Actual behavior
Error details
Environment data
Version
2.2.5
Visuals
No response
The text was updated successfully, but these errors were encountered: