ctigeek / InvokeQueryPowershellModule

A Powershell module of Cmdlets for querying most types of databases.
https://www.powershellgallery.com/packages/InvokeQuery
MIT License
58 stars 10 forks source link

SqLite Support? #19

Open projectje opened 4 years ago

projectje commented 4 years ago

How does it work?

$db = 'c:\Users\gebruiker\AppData\Roaming\Mozilla\Firefox\Profiles\ptk96eju.default-1565324776760514\places.sqlite'
$sql = "SELECT * FROM moz_bookmarks;"
Invoke-SqliteQuery -Sql $sql -Database $db -Verbose

:


VERBOSE: Using the following connection string: Data Source=.\localhost;Initial Catalog=c:\Users\gebruiker\AppData\Roaming\Mozilla\Firefox\Profiles\ptk96eju.default-1565324776760514\places.sqlite;
VERBOSE: Opening connection.
VERBOSE: Connection to database is open.
VERBOSE: Running query number 1
VERBOSE: Running the following query: SELECT * FROM moz_bookmarks;
VERBOSE: Performing the operation "Run Query:`SELECT * FROM moz_bookmarks;`" on target "Database server".
VERBOSE: Closing connection.
VERBOSE: Processed 1 queries in 5 milliseconds.
VERBOSE: Complete.
Invoke-SqliteQuery : SQL logic error or missing database
no such table: moz_bookmarks
At C:\sqlite-query.ps1:7 char:1
+ Invoke-SqliteQuery -Sql $sql -Database $db -Verbose -Server .\localho ...
+ ~~
```~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-SqliteQuery], SQLiteException
    + FullyQualifiedErrorId : System.Data.SQLite.SQLiteException,InvokeQuery.InvokeSqliteQuery