Posted in

Chrome can consume a lot of disk space – Cleanup script

The big consumers inside each profile are usually stored in user profiles in subfolders, all of which are safe to delete (Chrome rebuilds them):

  • Cache, Code Cache, GPUCache — disk cache, often gigabytes
  • Service Worker\CacheStorage — PWA/site caches
  • Application Cache (older Chrome)

To safely wipe caches across all profiles without losing logins, bookmarks, or passwords run this powershell script:

Get-ChildItem "$env:LOCALAPPDATA\Google\Chrome\User Data" -Directory |
  Where-Object { $_.Name -eq 'Default' -or $_.Name -like 'Profile*' } |
  ForEach-Object {
    $p = $_.FullName
    'Cache','Code Cache','GPUCache','Service Worker' | ForEach-Object {
      $target = Join-Path $p $_
      if (Test-Path $target) { Remove-Item $target -Recurse -Force -ErrorAction SilentlyContinue }
    }
  }

Microsoft Certified Trainer, Office 365, AWS, Azure and Cloud Expert-Architect. In the IT world for over than 20 years.

Apart from the main area of Microsoft Azure expert in the field of infrastructure servers Windows Server 2003-2019, Microsoft Active Directory, Hyper-V Private Cloud, IIS, System Center, SQL.

Private Cloud, System Center, Hyper-V, Open Stack Expert and all Microsoft products Expert. Linux Server administrator.

My Azure community projects:

https://mazeball.azurewebsites.net/
https://github.com/MariuszFerdyn?tab=repositories

More