Query SQL Server, Oracle, PostgreSql, SQLite, & mySql natively with PowerShell.
The basic pattern is to connect to a database, invoke one or more sql statements and then close your database connection. This module provides cmdlets that map to this basic pattern. Each Provider has its own 'Open-*Connection' cmdlet, but the remaining cmdlets are provider agnostic (MSSQL: Open-SqlConnection, Oracle: Open-OracleConnection, SQLite: Open-SQLiteConnection, etc). You can have multiple connections open, just distinguish them through the use of the -ConnectionName parameter on every command (if no ConnectionName is specified, it defaults to 'default').
Open-*Connection -DataSource "SomeServer" -InitialCatalog "SomeDB"
$data = Invoke-SqlQuery -query "SELECT * FROM someTable"
#or using parameters
$data = Invoke-SqlQuery -query "SELECT * FROM someTable WHERE someCol = @var" -Parameters @{var = 'a value'}
Close-SqlConnection