StevenM2330I also found the provided scrpt didn't work for the add-in. Also, it required a lot of work to add binaries for directories etc (not exactly automated for routine use). Anyway, here's what I came up with:
Install new Teams:
# set regKeys
$Teams = 'registry::HKLM\SOFTWARE\Microsoft\Teams'
$key = try {
Get-Item -Path $Teams -ErrorAction Stop
}
catch {
New-Item -Path $Teams -Force
}
New-ItemProperty -Path $key.PSPath -Name IsWVDEnvironment -PropertyType Dword -Value 1
New-ItemProperty -Path $key.PSPath -Name disableAutoUpdate -PropertyType Dword -Value 1
# Close handles
$key.Handle.Close()
# install new Teams
write-host 'AIB Customization: Install new Teams'
$appName = 'Teams'
$drive = 'C:\'
New-Item -Path $drive -Name $appName -ItemType Directory -ErrorAction SilentlyContinue
$LocalPath = $drive + '\' + $appName
set-Location $LocalPath
$newTeamsURL = 'https://go.microsoft.com/fwlink/?linkid=2243204&clcid=0x409'
$newTeamsURLexe = 'teamsbootstrapper.exe'
$outputPath = $LocalPath + '\' + $newTeamsURLexe
Invoke-WebRequest -Uri $newTeamsURL -OutFile $outputPath
write-host 'AIB Customization: Starting Install new Teams'
Start-Process -FilePath $outputPath -Args "-p" -Wait
write-host 'AIB Customization: Finished Install new Teams'
Install addin for all-users:
$appx = (Get-AppxPackage | Where-Object -Property Name -EQ -Value MSTeams)
$appVer = $appx.Version
$appxPath = $appx.InstallLocation
$MSIname = 'MicrosoftTeamsMeetingAddinInstaller.msi'
$meetingAddinMSI = $appxPath + '\' + $MSIName
$applockerinfo = (Get-AppLockerFileInformation -Path $meetingAddinMSI | Select -ExpandProperty Publisher)
$binVer = $applockerinfo.BinaryVersion
$targetDir = 'C:\Program Files (x86)\Microsoft\TeamsMeetingAddin' + '\' + $binVer + '\'
Start-Process -FilePath msiexec.exe -Args "/I `"$meetingAddinMSI`" /qn /norestart ALLUSERS=1 TARGETDIR=`"$targetDir`" /L*V C:\Teams\MeetingAddin.log" -Wait
Uninstall new Teams (for updates):
$appName = 'Teams'
$drive = 'C:\'
$LocalPath = $drive + '\' + $appName
set-Location $LocalPath
$newTeamsURLexe = 'teamsbootstrapper.exe'
$outputPath = $LocalPath + '\' + $newTeamsURLexe
write-host 'Starting uninstall of new Teams'
Start-Process -FilePath $outputPath -Args "-x" -Wait
write-host 'Finished uninstall of new Teams'