From b8662ef94ebd87934fe3dddd413dc5bbafdb91a2 Mon Sep 17 00:00:00 2001 From: Omnicef <69552619+Omnicef@users.noreply.github.com> Date: Tue, 25 Aug 2020 15:39:29 -0700 Subject: [PATCH] Create ClearGoogleChromeCache.ps1 --- scripts/ClearGoogleChromeCache.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/ClearGoogleChromeCache.ps1 diff --git a/scripts/ClearGoogleChromeCache.ps1 b/scripts/ClearGoogleChromeCache.ps1 new file mode 100644 index 00000000..547e22bc --- /dev/null +++ b/scripts/ClearGoogleChromeCache.ps1 @@ -0,0 +1,15 @@ +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” \ No newline at end of file