From 5e8064c9aadb3e622e7b532762ab91a3bae91e54 Mon Sep 17 00:00:00 2001 From: Omnicef <69552619+Omnicef@users.noreply.github.com> Date: Tue, 25 Aug 2020 15:46:46 -0700 Subject: [PATCH] Create ClearFirefoxCache.ps1 --- scripts/ClearFirefoxCache.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/ClearFirefoxCache.ps1 diff --git a/scripts/ClearFirefoxCache.ps1 b/scripts/ClearFirefoxCache.ps1 new file mode 100644 index 00000000..1e65fcd0 --- /dev/null +++ b/scripts/ClearFirefoxCache.ps1 @@ -0,0 +1,17 @@ +Write-Host “Exporting the list of users to c:\users.csv” +# List the users in c:\users and export to csv file for calling later +dir C:\Users | select Name | Export-Csv -Path C:\users.csv -NoTypeInformation +$list=Test-Path C:\users.csv +# Clear Google Chrome +Write-Host “Clearing FireFox caches” +Import-CSV -Path C:\users.csv -Header Name | foreach { +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\* -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\*.* -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache2\entries\*.* -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\thumbnails\* -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cookies.sqlite -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\webappsstore.sqlite -Recurse -Force -EA SilentlyContinue -Verbose +Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\chromeappsstore.sqlite -Recurse -Force -EA SilentlyContinue -Verbose +} +Remove-Item -path c:\users.csv +Write-Host “FireFox cache is cleared”