PowerShell - Removing old Teams installation folders in C:\Users\Appdata\Local

210 views Asked by At

Is there a way to remove old installations of Teams from every C:\users folder?

I've been messing with the below, but it doesn't appear to iterate properly through each user folder.

Get-ChildItem -Path "C:\users\*\appdata\local\microsoft\teams" -Recurse | where { (get-item C:\users\*\appdata\local\microsoft\teams\current\Teams.exe | % {$_.VersionInfo.ProductVersion}) -lt 1.6.00.18681} | Remove-Item -Recurse -Force

Please help! Thanks so much.

0

There are 0 answers