This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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." } |