Contents

The different types of tabs to add in Microsoft Teams when using 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.

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

 

/images/powershell-screenshots/Add-tabs-in-teams-using-powershell-img1.png  

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

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

 

/images/powershell-screenshots/Add-tabs-in-teams-using-powershell-img2.png  

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…

1
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 command. Look below what happens when you click on the newly created tab:

/images/powershell-screenshots/Add-tabs-in-teams-using-powershell-img3.png
 

/images/powershell-screenshots/Add-tabs-in-teams-using-powershell-img4.png  

Official Documentation
This is officially documented here: Configure the built-in tab types in Microsoft Teams.
 

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

1
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!