Skip to content

Instantly share code, notes, and snippets.

View ariendg's full-sized avatar

Ariendg ariendg

View GitHub Profile
@ariendg
ariendg / DetectionMethod phase2 updater included.ps1
Created March 27, 2025 13:01
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." }