bad image ?

Jun 30, 2012 at 7:16 AM
Edited Jun 30, 2012 at 1:43 PM

Tank you for this project. Looking forward to explore SQLite with Powershell.

I'm using V2.0, but when I import module sqlite, I get this message.

Can you tell me what it means and how I can solve it ? (Win7 laptop)

Import-Module : Could not load file or assembly 'file:///C:\Users\me\Documents\Windo
wsPowerShell\Modules\sqlite\bin\CodeOwls.PowerShell.SQLite.Provider.dll' or one of its
dependencies. This assembly is built by a runtime newer than the currently loaded runti
me and cannot be loaded.
At C:\Users\me\Documents\Powershell\SQLite test1.ps1:16 char:15
+     import-module <<<<  sqlite
    + CategoryInfo          : NotSpecified: (:) [Import-Module], BadImageFormatExcepti
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Comm


I think the above message may be related to Windows 8 ? ( I'm still on Win7)


I reverted to V1.0 and got that to work.

The only thing I notice is that querying a 10,000 rows table is sloooooow.  (full db = 1MB)
(csv export of full table = 600Kb)

As this is my first experience with SQLite and I only need to  extract a bout 50 rows at a time, taking me 2minutes,
I haven't got a good first impression on SQLite performance.

When I query the data using "SQLite Database Browser 2.0 b1" it goes relativly fast. ( 4 seconds )

What can I do to make my powershell exporting faster ?


Jul 3, 2012 at 7:46 PM


The error was my fault.  I've uploaded a fixed archive of 1.1 to address the issue.


Regarding the performance issues - PowerShell does a ton of work for each item returned from a provider.  The query itself takes almost no time at all, but the extra provider properties PowerShell adds to each item adds up to a significant amount of time.

I'd recommend using the new invoke-item feature of the v1.1 release if you need more performance from the module.  E.g., instead of this:

> ls db:\data

try this:

> invoke-item db:\ -sql "select * from data"


Using invoke-item will bypass the powershell item property management stuff; this will save you some time.

Jul 6, 2012 at 10:26 AM