You need to make sure that the System.Data.SQLite.dll file is correct for both versions (32 or 64) and .Net. For Win 7 x64, the default .Net is set to 3.5. Powershell will use .Net 3.5, even if you have installed 4.0 (or higher) clients. You can use .NET 4.0 in Powershell if you go through other hoops (discussed elsewhere).
Download the ADO SQLite package from:
http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
Locate Precompiled binaries for 64-bit Windows (.NET Framework 3.5 sp1) . Select the appropriate zip (with or without VC ++ runtime). Do not let 2008 (or 2010) in the file name fool you. This is a link to the version of VC ++ used for compilation. The project is relevant. The version at the time of this writing is 1.0.79.0 dated January 28, 2012. Unfortunately, the help file does not come with this package. The useful SQLite.Net.chm file is located in a separate source package in the docs \ folder.
Once the zip is extracted (no installation or registry fix required), specify your script file system in the dll using:
Add-Type -Path "<drive> <path> \ System.Data.SQLite.dll"
Example:
Add-Type -Path "C: \ sql \ sqliteFx35x64 \ System.Data.SQLite.dll"
The rest of the test code should work
source share