Skip to content

Instantly share code, notes, and snippets.

@robert-moses
Last active November 18, 2019 20:38
Show Gist options
  • Save robert-moses/12374bdeee8f491bc1cd5f4283faf0f9 to your computer and use it in GitHub Desktop.
Save robert-moses/12374bdeee8f491bc1cd5f4283faf0f9 to your computer and use it in GitHub Desktop.
PS to clear IE, Chrome and FF browser caches
#
#
# To Do:
# Switch to either another variable for user profiles (all) or to simply sort through the c:\users\ folder.
#
#
#Delete Internet Explorer Cache
Remove-Item -path "$env:USERPROFILE\AppData\Local\Microsoft\Windows\Temporary Internet Files\*" -Recurse -Force -EA SilentlyContinue -Verbose
Remove-Item -path "$env:USERPROFILE\AppData\Local\Microsoft\Windows\INetCache\*" -Recurse -Force -EA SilentlyContinue -Verbose
Write-Host -ForegroundColor yellow "Internet Explorer Cache Removal - COMPLETE"
#Delete Google Chrome Cache
Remove-Item -path "$env:USERPROFILE\AppData\Local\Google\Chrome\User Data\Default\Cache\*" -Recurse -Force -EA SilentlyContinue -Verbose
Write-Host -ForegroundColor yellow "Google Chrome Cache Removal - COMPLETE"
#Delete Firefox Cache
#Remove-Item -path "$env:USERPROFILE\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\*.*" -Recurse -Force -EA SilentlyContinue -Verbose
Remove-Item -path "$env:USERPROFILE\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache2\entries\*.*" -Recurse -Force -EA SilentlyContinue -Verbose
Write-Host -ForegroundColor yellow "Firefox Cache Removal - COMPLETE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment