Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- 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.
- 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.
- Use at your own risk.
- #>
- # Only look at files older than 30 days
- $limit = (Get-Date).AddDays(-30)
- $Counter = 0..99
- # note formatting of number so 0 becomes 00 and 1 becomes 01
- 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|
- Where-Object{$_.CreationTime -lt $limit})|
- remove-item -Force -ErrorAction SilentlyContinue}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement