Manage Microsoft Teams PowerShell Module

As most of us know, the steps to install and update the Microsoft Teams Powerhell Module are described here:

Install Microsoft Teams PowerShell Module

However, it is also possible to install, load and remove previous versions.

To list all installed versions we need to use the ListAvailable parameter:

Get-Module -ListAvailable MicrosoftTeams

By default, the module loaded with Import-Module MicrosoftTeams or Connect-MicrosoftTeams will be the latest installed version.

We can run the following PowerShell cmdlet, to confirm the module version that is currently loaded:

 Get-Module MicrosoftTeams

Note: If empty it means that the MicrosoftTeam PowerShell module isn’t loaded.

To load a specific version we need to use the RequiredVersion parameter:

Import-Module MicrosoftTeams -RequiredVersion x.x.x

This is useful in case that we need to check if a previous version had a different behavior.

The Uninstall-Module accepts the RequiredVersion parameter, this allows to uninstall a specific version. Then we check again all installed versions with the ListAvailable parameter:

Uninstall-Module MicrosoftTeams -RequiredVersion x.x.x

We can also install a specific version with Install-Module:

Install-Module MicrosoftTeams -RequiredVersion x.x.x

Please note that the PowerShell cmdlets used in this post will work for other PowerShell Modules.