jhorsman
5/14/2018 - 10:20 AM

Use SQLite with PowerShell

Use SQLite with PowerShell

if (-not (Get-Module PSSQLite -ListAvailable)) {
    Install-Module PSSQLite
}

Import-Module PSSQLite

$Database = Join-Path $PSScriptRoot "example.sqlite"

#Invoke-SqliteQuery -DataSource $Database -Query "SELECT name FROM sqlite_master WHERE type='table';"
#Invoke-SqliteQuery -DataSource $Database -Query "PRAGMA table_info('MY_TABLE')"
Invoke-SqliteQuery -DataSource $Database -Query "SELECT * FROM MY_TABLE"