Skip to content
Proxx edited this page May 8, 2015 · 23 revisions

NAME Connect-SQLite

SYNOPSIS Connect to SQLite Database file

SYNTAX Connect-SQLite [[-Database] ] [-Open] []

DESCRIPTION Create a System.Data.SQLite.SQLiteConnection Object to the SQLite Database

PARAMETERS -Database

    Required?                    false
    Position?                    1
    Default value                $($MyInvocation.PSScriptRoot) + "\database.db"
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-Open [<SwitchParameter>]
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see 
    about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS None. You cannot pipe objects to Connect-SQLite

OUTPUTS <System.Data.SQLite.SQLiteConnection>

-------------------------- EXAMPLE 1 --------------------------

C:\PS>$conn = Connect-SQLite -Database <FilePath>








-------------------------- EXAMPLE 2 --------------------------

C:\PS>$conn = Connect-SQLite -Database <FilePath> -Open








-------------------------- EXAMPLE 3 --------------------------

C:\PS>$conn = Connect-SQLite -Open


When run in Script the database file is located in $PSscriptRoot with the name: database.db
But if you run this from Console the database file is located in $pwd location





-------------------------- EXAMPLE 4 --------------------------

C:\PS>$conn = Connect-SQLite -Database :MEMORY:


(creates a SQLite database in memory)

RELATED LINKS http://www.proxx.nl/

Clone this wiki locally