Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ariendg/e8682157303a64224775b90cbec85fa0 to your computer and use it in GitHub Desktop.
Save ariendg/e8682157303a64224775b90cbec85fa0 to your computer and use it in GitHub Desktop.
Uninstall the classic Teams client using a script DetectionMethod phase2 updater included
$softwareInstalled = Get-CimInstance -ClassName Win32_Product
$isTeamsClassicInstalled = Test-Path "$($ENV:SystemDrive)\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exe" -ErrorAction SilentlyContinue
$TeamsIcon_oldDesktop = Test-Path "$($ENV:SystemDrive)\Users\*\Desktop\Microsoft Teams classic.lnk" -ErrorAction SilentlyContinue
switch ($true) {
($softwareInstalled.Name -match 'Microsoft Teams Classic') { break }
($softwareInstalled.Name -match 'Teams Machine-Wide Installer') { break }
($isTeamsClassicInstalled) { break }
($TeamsIcon_oldDesktop) { break }
Default { Write-Output "No old Teams version found on this device. No actions will be performed." }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment