DEV Community

Bas van Ombergen
Bas van Ombergen

Posted on • Originally published at basvo.github.io on

2 2

Remove AzureRm before installing Az module

Installing the Az module on a machine that already contains AzureRm is not supported.

image-20210305203623990

There are a couple of steps needed to remove AzureRm. I will describe them below. We should first execute the following commands:

uninstall-module Azure
uninstall-module AzureRM

Enter fullscreen mode Exit fullscreen mode

Then we should check if any modules remain by using the following command:

Get-Module -ListAvailable | Where {$_.Name -like 'AzureRM.*'}

Enter fullscreen mode Exit fullscreen mode

This will probably give a result like this:

image-20210305203939231

Remove all the remaining modules for AzureRM by using the following command:

$Modules = Get-Module -ListAvailable | Where {$_.Name -like 'AzureRM.*'}
Foreach ($Module in $Modules) {Uninstall-Module $Module}

Enter fullscreen mode Exit fullscreen mode

Now we can try installing the Az module again:

if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM -ListAvailable)) {
    Write-Warning -Message ('Az module not installed. Having both the AzureRM and ' +
      'Az modules installed at the same time is not supported.')
} else {
    Install-Module -Name Az -AllowClobber -Scope CurrentUser
}

Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay