Skip to content

Get-MSTTeamsApp-Html

Teams: HTML report of Teams apps

#Requires -Version 5.1

[CmdletBinding()]
Param(
    [string]$AppId,
    [string]$ExternalID,
    [string]$DisplayName,
    [ValidateSet('organization','global')]
    [string]$DistributionMethod
)

Process {
    try {
        [hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'}
        if ($PSBoundParameters.ContainsKey('AppId')) { $cmdArgs.Add('Id', $AppId) }
        if ($PSBoundParameters.ContainsKey('ExternalID')) { $cmdArgs.Add('ExternalID', $ExternalID) }
        if ($PSBoundParameters.ContainsKey('DisplayName')) { $cmdArgs.Add('DisplayName', $DisplayName) }
        if ($PSBoundParameters.ContainsKey('DistributionMethod')) { $cmdArgs.Add('DistributionMethod', $DistributionMethod) }

        $result = Get-TeamsApp @cmdArgs | Select-Object * | Sort-Object -Property DisplayName

        if ($null -eq $result -or $result.Count -eq 0) {
            Write-Output "No Teams apps found"
            return
        }

        Write-Output ($result | ConvertTo-Html -Fragment)
    }
    catch { throw }
}

The app's ID generated by Teams

The external ID of the app from Azure AD

Name of the app visible to users

The type of app (organization or global)

An interactive directory of PowerShell scripts.