Pagine

PowerShell #delete specific folders through script

In case you need to search recursively  folders in a specific path and then delete them you can use below powershell script. (these example folders are related to teams cache cleaning topic)

Be aware that -whatif option permits to see output without really deleting folders. 

Get-ChildItem "diskdrive:\path\*\AppData\Roaming\Microsoft\Teams\*" -directory | Where name -in ('application cache','blob storage','databases','GPUcache','IndexedDB','Local Storage','tmp', 'cache') | ForEach{Remove-Item $_.FullName -Recurse -Force -whatif}