1
votes

I do have a problem getting the MicrosoftTeams module loaded in PowerShell. I downloaded and imported the module with AllSigned authorization (no errors):

PS C:\WINDOWS\system32> Install-Module -Name MicrosoftTeams
PS C:\WINDOWS\system32> Import-Module MicrosoftTeams

Checking, whether the Module is loaded correctly, I also printed the available modules where it is displayed with the current version number:

PS C:\WINDOWS\system32> get-module -listavailable


    Verzeichnis: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.1      Microsoft.PowerShell.Operation.V... {Get-OperationValidation, Invoke-OperationValidation}
Binary     1.1.4      MicrosoftTeams                      {Add-TeamUser, Connect-MicrosoftTeams, Disconnect-Microsof...
Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
Script     3.4.0      Pester                              {Describe, Context, It, Should...}
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}
Script     2.0.0      PSReadline                          {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remov...

Now, I wanted to connect to the Teams using the cmdlet Connect-MicrosoftTeams which is explicitly listed as one of the exported cmdlets in this imported module. But somehow, PowerShell does not find the command:

PS C:\WINDOWS\system32> Connect-MicrosoftTeams
Connect-MicrosoftTeams : Die Benennung "Connect-MicrosoftTeams" wurde nicht als Name eines Cmdlet, einer Funktion,
einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der
Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ Connect-MicrosoftTeams
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Connect-MicrosoftTeams:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

[Excuse the German: It reads: The name was not recognized as cmdlet or name of a function. But you probably know the message if you use PS]

Now, my question is: How can I get PS to recognize the command and how do I find out where the error lies? Is there a command to list the currently running scripts and available commands? Or is there a possibility to force the script to be executed?

2
Thank You for accepting answer, this will help others in the community with similar question. Could you please spare one min to let us know how we did by clicking on this feedback link?Nikitha-MSFT

2 Answers

2
votes

I can see the output shows you have installed the module successfully. However, it seems to have some problem. I suggest you re-install it to see how it goes:

  1. Run Windows PowerShell as an administrator
  2. Run the command Uninstall-Module MicrosoftTeams,close PowerShell and re-open a new elevated PowerShell session
  3. Run the command Install-Module MicrosoftTeams,related doc. https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-install

After it is installed successfully,please Close PowerShell and re-open a new elevated PowerShell session as an administrator,run Connect-MicrosoftTeams again and see whether it works now. If the same issue persists,attach the screenshot of the entire output for further check.

0
votes

I had to install the "Skype for Business Online, Windows PowerShell Module" to get Connect-MicrosoftTeams https://www.microsoft.com/en-us/download/details.aspx?id=39366