Apps/Get-MicrosoftTeams.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$DownloadURL = 'https://raw.githubusercontent.com/ItzLevvie/MicrosoftTeams-msinternal/master/defconfig'
$DownloadText = (Invoke-WebRequest -Uri $DownloadURL -DisableKeepAlive -UseBasicParsing).Content

$Rings = @('Continuous Deployment', 'Exploration', 'Preview', 'Production')
$Architectures = @('x64', 'x86', 'ARM64')
$Types = @('Exe', 'MSI')

foreach ($Ring in $Rings) {
    foreach ($Architecture in $Architectures) {
        foreach ($Type in $Types) {

            $RegEx = "$Channel(?:.+\n)+((?:\d+\.)+\d+).+win-$Architecture.+(http.+\.$Type)"

            if ($DownloadText -match $RegEx) {
                New-NevergreenApp -Name 'Microsoft Teams' -Version $matches[1] -Uri $matches[2] -Architecture $Architecture -Type $Type -Ring $Ring
            }
            else {
                Write-Warning "No match found for Microsoft Teams $Channel $Architecture $Type"
            }

        }
    }
}