Skip to content

Instantly share code, notes, and snippets.

@CrazyLlama
Last active March 4, 2022 14:11
Show Gist options
  • Save CrazyLlama/74650b0f50e1974fad5251648d802390 to your computer and use it in GitHub Desktop.
Save CrazyLlama/74650b0f50e1974fad5251648d802390 to your computer and use it in GitHub Desktop.
<#
.SYNOPSIS
sqlite.ps1 - Install, run, and uninstall sqlite for all you hacky needs.
.OUTPUTS
Should be no outputs other than what is generated in the sqlite session.
.EXAMPLE
.\sqlite.ps1 - _Runs the script_
.NOTES
Underscores denote sarcasm
#>
# Change to "Downloads" and create placeholder for download
Set-Location -Path "Downloads"
New-Item Downloads\sqlite-tools-win32-x86-3230100.zip -ItemType file
# Download sqlite and expand archive
(new-object System.Net.WebClient).DownloadFile("https://www.sqlite.org/2020/sqlite-tools-win32-x86-3230100.zip","Downloads\sqlite-tools-win32-x86-3230100.zip")
Expand-Archive -Path sqlite-tools-win32-x86-3230100.zip
# Change dir to sqlite tools
Push-Location sqlite-tools-win32-x86-3230100\sqlite-tools-win32-x86-3230100
# Run it!
.\sqlite3.exe
<#
> # For Google Chrome history:
>.shell cd C:\Users\[username]\AppData\Local\Google\Chrome\User^ Data\Default
>.open History
>
#>
# Go back to where you came from
Pop-Location
# Cleanup
Remove-Item sqlite-tools-win32-x86-3230100 -recurse
Remove-Item sqlite-tools-win32-x86-3230100.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment