Skip to content
PowerShell Script

PowerShell Script – Clear Microsoft Teams Cache

When your Microsoft Teams application is behaving strange or have issues, one of the first steps in troubleshooting is to clear the cache. You can do this manually or using a script

If you check Clear Teams cache Microsoft Learn (at present time), they recommend you delete the whole App folder. This will also delete your custom backgrounds, the script let you choose which folders to remove.

To see the folders you delete; open the Run dialog (Win+R). Enter %appdata%\Microsoft\Teams, and click OK. The script has an array to choose which folder to delete, you can change the array to fit your needs.

Check my repo on GitHub, to get the latest updates in case I create some new options or change the standard folders. Use this script to learn more

3 thoughts on “PowerShell Script – Clear Microsoft Teams Cache”

  1. ty

    think ill use but need it to delete the whole teams folder which is what we do at our company

    but the restart doesnt work. we dont have an update file after

  2. This is interesting! It automatically closes and opens the teams application after clearing the cache. This is quite impressive!

    1. Indeed, this line does so
      Get-Process -ProcessName Teams | Stop-Process -Force
      The Get-Process finds the process with the name “Teams” pipes it to the Stop-Process command.
      Start-Process -File "$($env:USERProfile)\AppData\Local\Microsoft\Teams\Update.exe" -ArgumentList '--processStart "Teams.exe"'
      Here it starts the Process again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.