Advertisement
crexin

Clean Chrome FileSystemCache

Aug 10th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. Clean up overgrown Chrome filesystem cache.  Removed about 6 million files taking up 24 GB of space -- takes a long time to run if you have a large number of files to delete.
  3. Change username and Profile number in path to a valid path first before running script.  Script is set to continue on if a file is in use and cannot be deleted.
  4.  
  5. Use at your own risk.
  6. #>
  7. # Only look at files older than 30 days
  8. $limit = (Get-Date).AddDays(-30)
  9. $Counter = 0..99
  10. # note formatting of number so 0 becomes 00 and 1 becomes 01
  11. foreach($number in $Counter) {$number = "{0:00}" -f $number;(dir -r "C:\Users\username\AppData\Local\Google\Chrome\User Data\Profile 8\Storage\ext\fahmaaghhglfmonjliepjlchgpgfmobi\def\File System\primary\p\$number" -file|
  12. Where-Object{$_.CreationTime -lt $limit})|
  13. remove-item -Force -ErrorAction SilentlyContinue}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement