Uninstall all Azure PowerShell Modules
With Azure PowerShell modules changing all the time and the recent introduction of the PowerShell modules being renamed from AzureRm to Az , you may want to totally uninstall all modules and reinstall to make sure you are using the latest and greatest modules. To do so, the following scripit will go through and cleanup all the Azure(RM)(AD) modules. Simply open up PowerShell as an Administrator and execute the following PowerShell workflow/commands: workflow Uninstall-AzureModules { $Modules = @() $Modules += (Get-Module -ListAvailable Azure*).Name $Modules += (Get-Module -ListAvailable Az.*).Name Foreach -parallel ($Module in ($Modules | Get-Unique)) { if($Modules) { Write-Output ("Uninstalling: $Module") Uninstall-Module $Module -Force } else { Write-Output ("Uninstalling: Module '$Module' is null or empty") } } } Uninstall-AzureM