Skip to content

Get-MSTTeamTemplateList

Teams: Get all team templates available to the tenant

#Requires -Version 5.1

[CmdletBinding()]
Param(
    [string]$PublicTemplateLocale,
    [ValidateSet('*','AppCount','Category','ChannelCount','Description','IconUri','Id','Locale','ModifiedBy','ModifiedOn','Name','OdataId','PublishedBy','Scope','ShortDescription','Visibility')]
    [string[]]$Properties = @('Name','OdataId','ShortDescription','AppCount','ChannelCount','ModifiedBy','ModifiedOn','Scope','Visibility')
)

Process {
    try {
        if ($Properties -contains '*') {
            $Properties = @('*')
        }
        [hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'}
        if ($PSBoundParameters.ContainsKey('PublicTemplateLocale')) {
            $cmdArgs.Add('PublicTemplateLocale', $PublicTemplateLocale)
        }

        $result = Get-CsTeamTemplateList @cmdArgs | Select-Object $Properties

        if ($null -eq $result -or $result.Count -eq 0) {
            Write-Output "No team templates found"
            return
        }
        foreach ($item in $result) {
            $item | Add-Member -NotePropertyName Timestamp -NotePropertyValue (Get-Date -Format 'yyyy-MM-dd HH:mm:ss') -PassThru -Force
        }
    }
    catch { throw }
}

The language and country code of templates localization

List of properties to expand. Use * for all properties

An interactive directory of PowerShell scripts.