Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Forked from jonkyops/ClearGsCookies.ps1
Created November 6, 2017 09:43
Show Gist options
  • Save jpluimers/ac3afd467c20e54ad1108a96899e0b25 to your computer and use it in GitHub Desktop.
Save jpluimers/ac3afd467c20e54ad1108a96899e0b25 to your computer and use it in GitHub Desktop.
# DISCLAIMER: No warranty. Please read this script carefully before running and use at your own risk!
# Clears gsScrollPos cookies from chrome as temporary workaround for https://github.com/deanoemcke/thegreatsuspender/issues/537
# PSSQLite module required: https://www.powershellgallery.com/packages/PSSQLite/ - https://github.com/RamblingCookieMonster/PSSQLite
# WARNING: This WILL close any running chrome processes. This script will also need to be run as administrator to stop the chrome processes.
Import-Module PSSQLite
$null = Get-Process 'chrome' -ErrorAction SilentlyContinue | %{$_.CloseMainWindow()}
$DataSource = '~\AppData\Local\Google\Chrome\User Data\Default\Cookies'
$Query = "delete from cookies where name like 'gsScrollPos-%'"
Invoke-SqliteQuery -DataSource $DataSource -Query $Query
Start-Process 'chrome'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment