PowerShell 技能连载 - 删除 Microsoft Teams 缓存数据

如果您使用 Microsoft Teams 进行视频会议,则有时可能需要清理缓存文件并删除驻留在许多子文件夹中的残留数据。

您可以调整上一个示例中的代码来进行清理:

1
2
3
4
5
6
7
8
9
# the folder that contains the Microsoft Teams data
$parentFolder = "$env:userprofile\AppData\Roaming\Microsoft\Teams\*"
# list of subfolders that cache data
$list = 'application cache','blob storage','databases','GPUcache','IndexedDB','Local Storage','tmp'

# delete the folders found in the list
Get-ChildItem $parentFolder -Directory |
Where-Object name -in $list |
Remove-Item -Recurse -Verbose

If you have Administrator privileges and would like to remove cached Microsoft Teams data for all users, change $parentFolder like this:
如果您具有管理员权限,并想为所有用户删除缓存的 Microsoft Teams 数据,请按如下所示更改 $parentFolder

1
$parentFolder = "c:\users\*\AppData\Roaming\Microsoft\Teams\*"
评论