Uninstall-PSResource: • Uninstall is not checking for dependencies (for Az modules)
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
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.