The Public Preview and Beta modules are useful for testing new features, i.e. managing Private Channel users (Get-TeamChannelUser, Add-TeamChannelUser etc)
Installing Beta Module
Microsoft documentation used to point you to the poshtestgallery.com to get the module. This has now been replaced by the Preview Module however some MS documentation (i.e. Get-TeamChannelUser) still references Posh Test Gallery.
If you try to install a module from Posh Test Gallery you will get the following error:
No match was found for the specified search criteria and module name
‘MicrosoftTeams’.
It would appear over the last couple of weeks (August 2020) the MicrosoftTeams module on PoshTestGallery returns a “404 – Page not found” indicating Microsoft have removed it. The link is still on the home page and is discussed here: https://github.com/PowerShell/PowerShellGallery/issues/119
Install Public Preview Module
Get-TeamChannelUser still advises to install the Beta module from Posh Test Gallery and Add-TeamsChannelUser advises to install the “Public Preview” version from PowerShell Gallery (I’m sure MS are in the process of updating their documentation):
You may get a couple of errors when trying to install the Public Preview module
Install-Module : Cannot process argument transformation on parameter 'RequiredVersion'. Cannot convert value
"1.1.3-preview" to type "System.Version". Error: "Input string was not in a correct format."
Install-Module : A parameter cannot be found that matches parameter name 'AllowPreRelease'.
The main problem you need to address is AllowPreRelease being missing from Install-Module. This is due to PowerShellGet being out of date on your machine. You would think “Update-Module -Name PowerShellGet” would resolve, but you just get a different error:
Update-Module : Module 'PowerShellGet' was not installed by using Install-Module, so it cannot be updated.
To resolve you have to use Install-Module and specify the -Force switch (Also specify repo if you have multiple installed)
Install-Module -Name PowerShellGet -Repository PSGallery -Force
Once PowerShellGet has been updated, I found I had to open a new PowerShell window before I could install the Teams Preview Module. To install the module run:
Uninstall-Module MicrosoftTeams
Install-Module -Name MicrosoftTeams -RequiredVersion 1.1.3-preview -AllowPrerelease
If you run “Get-Command -Name ‘*teamchannel*’ you will see all “TeamChannelUser commands are in the Preview Module.
Technical Architect at Symity
Chris, thanks for this article. I hit pretty much all of this. A couple of additional things I needed to do:
1) I had to restart the shell after updating PowershelGet in order to get the -AllowPrerelease parameter available on the Install-Module cmdlet
2) The -RequiredVersion parameter doesn’t seem to work for preview releases … the -Allowprerelase does the job now
3) Version 1.1.5 (preview) is now the latest version and the -AllowPrerelease installs this by default now
4) Now with 1.1.5 I have the Get-TeamChannelUser cmdlet that was missing in 1.1.4
Thanks Chris, i was in a world of hurt until I found your article. Worked a treat. Cheers from Brisbane, Australia