PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Uninstall-PSResource: • Uninstall is not checking for dependencies (for Az modules)

Open SydneyhSmith opened this issue 3 years ago • 3 comments

Summary of the new feature / enhancement

• Uninstall is not checking for dependencies – Here is a repro. Note that Az.Accounts is removed instead of throwing an error.

PS> Install-PSResource Az.Billing -Repository PSGallery -Reinstall -PassThru

Name Version Prerelease Repository Description


Az.Billing 2.0.0.0 PSGallery Microsoft Azure PowerShell - Billing service cmdlets for Azure Resource Mana… Az.Accounts 2.9.1.0 PSGallery Microsoft Azure PowerShell - Accounts credential management cmdlets for Azur…

PS> Uninstall-PSResource Az.Accounts PS> gmo az.* -list

Directory: C:\Users\sewhee\Documents\PowerShell\Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands


Script 2.0.0 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…

Proposed technical implementation details (optional)

No response

SydneyhSmith avatar Aug 15 '22 15:08 SydneyhSmith

I think here the ask would boil down to the Uninstall-PSResource cmdlet to look up all other modules on the system that may have a dependency on any of the dependencies of the module to be uninstalled and then determine whether or not those dependencies can also be removed safely or not.

kilasuit avatar Aug 15 '22 16:08 kilasuit