Guide to Microsoft Teams tab types with PnP PowerShell

In this blog post, I wanted to talk about the different types of tabs you can add in Microsoft Teams when using PnP PowerShell. More specifically about the -Type parameter which offers multiple values, but also because we have a dynamic parameter for the Add-PnPTeamsTab cmdlet.

The easy ones…

Most of them are pretty self explanatory. For instance, -Type PowerPoint or -Type WebSite. We also provide an example in the Add-PnPTeamsTab documentation for the PDF type.

Let’s go through a couple of them.

Add-PnPTeamsTab -Team "Marketing" -Channel "General" -DisplayName "Veronique's Blog" -Type Website -ContentUrl "https://veronicageek.com"

We have our website added using the -ContentUrl parameter (remember that for later 😉)

Now let’s add a document library. We need to use the -Type DocumentLibrary

Add-PnPTeamsTab -Team "Marketing" -Channel "General" -DisplayName "Documents LibType" -Type DocumentLibrary -ContentUrl "https://<TENANT-NAME>.sharepoint.com/sites/Marketing/Shared Documents"

We needed to provide the full path of the document library in question, using also the -ContentUrl parameter.

The confusing one…

Amongst the list of values for the -Type parameter, there’s one that might throw you off. What about the -Type SharePointPageAndList ? Should it not be similar to the DocumentLibrary value? We provide the full URL and off we pop! 🧐 Nope, we don’t.

Let’s try something…

Add-PnPTeamsTab -Team "Marketing" -Channel "General" -DisplayName "SPPageAndList Type" -Type SharePointPageAndList -ContentUrl "<Full path of your list>"

Well if you run this, you will get an error. And it also means that you full typed the command without validating the parameters using the “tab” on your keyboard! 😜

Remember when I spoke earlier about the -ContentUrl parameter? It’s a dynamic parameter. Meaning it’s only available for supported types… And it’s not available when using the SharePointPageAndList value.

Why is that?

Because this tab type cannot be ‘pre-configured’. All the configuration must be done in the Microsoft Teams UI after running the PowerShell command. Look below what happens when you click on the newly created tab:

If you still want to use it, just run the following PowerShell cmdlet:

Add-PnPTeamsTab -Team "Marketing" -Channel "General" -DisplayName "SPPageAndList TabType" -Type SharePointPageAndList

Is there an alternative?

Yes! Use the -Type WebSite and you should be good to go.

Thanks for reading! 🙂

Discover more from Veronique's Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading