Merge pull request #210 from mckinnon81/scripts
Fixed Paths in ClearFirefoxCache.ps1 & ClearGoogleChromeCache.ps1
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
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”
|
||||
Write-Host "Clearing FireFox caches"
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\*.*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache2\entries\*.*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\thumbnails\*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\cookies.sqlite" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\webappsstore.sqlite" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*.default\chromeappsstore.sqlite" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Write-Host "FireFox cache is cleared"
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
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 Google caches”
|
||||
Import-CSV -Path C:\users.csv -Header Name | foreach {
|
||||
Remove-Item -path “C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cache\*” -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path “C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cache2\entries\*” -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path “C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cookies” -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path “C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Media Cache” -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path “C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cookies-Journal” -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
}
|
||||
Remove-Item -path c:\users.csv
|
||||
Write-Host “Google Chrome cache is cleared”
|
||||
Write-Host "Clearing Google caches"
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Cache\*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Cache2\entries\*" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Cookies" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Media Cache" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Remove-Item -path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Cookies-Journal" -Recurse -Force -EA SilentlyContinue -Verbose
|
||||
Write-Host "Google Chrome cache is cleared"
|
||||
|
||||
Reference in New Issue
Block a user