Skip to content

Instantly share code, notes, and snippets.

@edumco
Last active June 20, 2022 14:06
Show Gist options
  • Save edumco/424f812420df138b2da41511e877df6a to your computer and use it in GitHub Desktop.
Save edumco/424f812420df138b2da41511e877df6a to your computer and use it in GitHub Desktop.
Microsoft Teams tricks

Teams Issues

Teams is a super-app with multiple plugins and sub-apps that can cause some troubles from time to time.

Here are some tips to fix and to prevent a lot of small troubles and performance botlenecks.

Cache cleaning

Basic Cleaning PowerShell Script

# Closes Microsoft Teams process
taskkill /IM teams.exe /F /T

# Defines the policy for this script.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process

# Removes specific safe to remove cache files from 3 locations

Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams")) -Directory `
| Where-Object { $_.Name -in ('blob_storage', 'Cache', 'Application Cache', 'Code Cache', 'databases', 'GPUCache', 'IndexedDB', '') } `
| ForEach-Object { Remove-Item $_.FullName -Recurse -Force };

Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams\meeting-addin")) -Directory `
| Where-Object { $_.Name -in ('Cache', '') } `
| ForEach-Object { Remove-Item $_.FullName -Recurse -Force };

Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams\Service Worker")) -Directory `
| Where-Object { $_.Name -in ('CacheStorage', 'ScriptCache', '') } `
| ForEach-Object { Remove-Item $_.FullName -Recurse -Force };

Full Teams cleaning

# Closes Microsoft Teams process
taskkill /IM teams.exe /F /T

# Defines the policy for this script.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process


Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%appdata%")) -Directory `
| Where-Object { $_.Name -in ('Teams', '') } `
| ForEach-Object { Remove-Item $_.FullName -Recurse -Force };

Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%Programdata%")) -Directory `
| Where-Object { $_.Name -in ('Teams', 'SquirrelMachineInstalls', '') } `
| ForEach-Object { Remove-Item $_.FullName -Recurse -Force };

  • C:\Users<username>\AppData\Local\Microsoft
  • C:\Users<username>\AppData\Roaming\Microsoft
  • C:\Users<username>\AppData\Roaming

Full app reinstall

reboot system

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment