Редагувати

Поділитися через


Install Microsoft Teams PowerShell Module

This article explains how to install the Microsoft Teams PowerShell module using PowerShell Gallery.

Requirements

Microsoft Teams PowerShell module requires Windows PowerShell 5.1 or PowerShell 7.2 or later on all platforms. Install the latest version of PowerShell available for your operating system.

To check your PowerShell version, run the following command from within a PowerShell session:

$PSVersionTable.PSVersion

We recommend that you use the Install-Module cmdlet to install the Microsoft Teams PowerShell module.

If PowerShell Gallery (PSGallery) isn't configured as a trusted repository for PowerShellGet, the first time you use the PSGallery you see the following message:

Untrusted repository

You are installing the modules from an untrusted repository. If you trust this repository, change
its InstallationPolicy value by running the `Set-PSRepository` cmdlet.

Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"):

Answer Yes or Yes to All to continue with the installation.

Installing using the PowerShellGallery

Microsoft Teams PowerShell module is currently supported for use with Windows PowerShell 5.1 or PowerShell 7.2 or later. Follow these steps to install the module with Windows PowerShell 5.1 for example:

  • Update to Windows PowerShell 5.1. If you're on Windows 10 version 1607 or higher, you already have PowerShell 5.1 installed.

  • Install .NET Framework 4.7.2 or later.

  • Run the following command to install the latest PowerShellGet:

    Install-Module -Name PowerShellGet -Force -AllowClobber
    
  • Install the Teams PowerShell Module.

    Install-Module -Name MicrosoftTeams -Force -AllowClobber
    

Offline Installation

In some environments, it's not possible to connect to the PowerShell Gallery. In those situations, follow these manual installation steps.

Sign in

To start working with Microsoft Teams PowerShell module, sign in with your Azure credentials.

Connect-MicrosoftTeams

Update Teams PowerShell Module

To update any PowerShell module, you should use the same method used to install the module. For example, if you originally used Install-Module, then you should use Update-Module to get the latest version.

Update-Module MicrosoftTeams

Warning

If Teams PowerShell has already been imported into your PowerShell session, updating the module will fail. Close PowerShell and re-open a new elevated PowerShell session.

Uninstall Teams PowerShell

To uninstall Microsoft Teams PowerShell, open a new PowerShell session and use the below method:

Uninstall-Module MicrosoftTeams

# Uninstall all versions of the module
Uninstall-Module MicrosoftTeams -AllVersions

Next Steps

Now you're ready to manage Microsoft Teams using Microsoft Teams PowerShell. See Managing Teams with Teams PowerShell to get started.

Managing Teams with Teams PowerShell

Teams PowerShell Release Notes

Microsoft Teams cmdlet reference