trying to connect to Teams powershell, getting exception error

Darryl 256 Reputation points
2021-11-19T13:49:51.063+00:00

I'm trying to get some Teams powershell to work on my colleagues windows 10 machine. I can install the MicrosoftTeams module but when I run Connect-MicrosoftTeams I get the following error:

Connect-MicrosoftTeams : The type initializer for 'Microsoft.Applications.Events.Helper.LibraryInfo' threw an exception.
At line:1 char:1

  • Connect-MicrosoftTeams
  • ~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Connect-MicrosoftTeams], TypeInitializationException
  • FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.TeamsCmdlets.Powershell.Connect.ConnectMicrosoftTeams

It works fine for me on my machine, any ideas?

EDIT:
It works on my colleagues machine in Visual studio code, but not in the powershell window or ISE.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,125 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,382 questions
0 comments No comments
{count} votes

Accepted answer
  1. JimmyYang-MSFT 49,031 Reputation points Microsoft Vendor
    2021-11-22T07:54:00.453+00:00

    Hi @Darryl

    What is your Teams module version in your colleague's device?

    In this case, we firstly recommend you check if you have PowerShell 5.1 or higher on all platforms. If not, please install the latest version of PowerShell available for your operating system.

    Meanwhile, you could try to re-install it to see how it goes:

    1. Run Windows PowerShell as an administrator. Run the command Uninstall-Module -Name MicrosoftTeams
    2. Run the Install-Module MicrosoftTeams command. If prompted to install the NuGet provider, type Y and press ENTER. If prompted to install the module from PSGallery, type Y and press ENTER.

    After it is installed successfully, please Connect-MicrosoftTeams again and see whether it works now. If the same issue persists, please capture a screenshot of the entire output for further check.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 additional answers

Sort by: Most helpful