Today, the Az.Sql module would not load on my machine when attempting to manually fail over a SQL Managed Instance with this error:

module could not be loaded

I followed the advice of the error message and tried to import the module to get further information.

module is already loaded

Hmmm :thinking:

I decided to uninstall the Azure PowerShell from my machine using the Windows 10 Settings App. Looks like an old version.

Uninstall Azure PowerShell

I then tried to reinstall the Az module using PowerShell but it still found an old version in my personal OneDrive\Documents folder.

Warning version already installed

I went into Windows Explorer and deleted that, and then all was fine for the installation and the PowerShell cmdlets for Az.Sql worked fine again.

Installing module for all users
Working fine now