1
Vote

Issue with using invoke-item -sql

description

I've installed the 1.1 version of sqlite powershell provider, when I attempt to use invoke-item method it fails, below is an excerpt of some sample code and the error message.
clear
Import-Module sqlite
New-PSDrive -Name MyDB -PSProvider SQLite -Root ""
new-item -Path mydb:/Test -Value "ID INTEGER PRIMARY KEY,Uname TEXT NOT NULL,uid INTEGER"
new-item -Path mydb:/Test -uname "Joe" -uid 1
new-item -Path mydb:/Test -uname "Jim" -uid 2
Get-ChildItem mydb:test
Invoke-Item mydb:\test -sql "select * from test"
Remove-PSDrive MyDB
Invoke-Item : A parameter cannot be found that matches parameter name 'sql'.
At line:8 char:28
  • Invoke-Item mydb:\test -sql <<<< "select * from test"
    • CategoryInfo : InvalidArgument: (:) [Invoke-Item], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeItemCommand

comments

beefarino wrote Aug 1, 2012 at 4:41 PM

I can't replicate this behavior - your code above works just fine for me...

Can you verify the version of the module you're loading by running these commands?

import-module sqlite;
get-module sqlite | select -exp path | gi | select *

Please copy the output into this issue.

NatDavis wrote Aug 1, 2012 at 5:29 PM

import-module sqlite;
NIS-H3VTHQ1\C:\PowerShell ndavis 08/01/2012 09:27:16>
get-module sqlite | select -exp path | gi | select *


PSPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin\CodeOwls.PowerShell.SQLite.Provider.dl
                l
PSParentPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin
PSChildName : CodeOwls.PowerShell.SQLite.Provider.dll
PSDrive : C
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : False
ReparsePoint :
VersionInfo : File: C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin\CodeOwls.PowerShell.SQLite.Provider.dll
                InternalName:     CodeOwls.PowerShell.SQLite.Provider.dll
                OriginalFilename: CodeOwls.PowerShell.SQLite.Provider.dll
                FileVersion:      1.0.0.0
                FileDescription:  CodeOwls.PowerShell.SQLite.Provider
                Product:          CodeOwls.PowerShell.SQLite.Provider
                ProductVersion:   1.0.0.0
                Debug:            False
                Patched:          False
                PreRelease:       False
                PrivateBuild:     False
                SpecialBuild:     False
                Language:         Language Neutral
BaseName : CodeOwls.PowerShell.SQLite.Provider
Mode : -----
Name : CodeOwls.PowerShell.SQLite.Provider.dll
Length : 41984
DirectoryName : C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin
Directory : C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin
IsReadOnly : False
Exists : True
FullName : C:\Users\ndavis\Documents\WindowsPowerShell\Modules\sqlite\bin\CodeOwls.PowerShell.SQLite.Provider.dll
Extension : .dll
CreationTime : 2/8/2012 2:40:23 PM
CreationTimeUtc : 2/8/2012 10:40:23 PM
LastAccessTime : 2/8/2012 2:40:23 PM
LastAccessTimeUtc : 2/8/2012 10:40:23 PM
LastWriteTime : 1/22/2012 1:40:42 PM
LastWriteTimeUtc : 1/22/2012 9:40:42 PM
Attributes : Normal

beefarino wrote Aug 2, 2012 at 4:26 PM

The file and product version should be 1.1.0.0; looks like you are importing the previous version of the module where these versions are 1.0.0.0.

Can you verify your installation and module path? Make sure that you've extracted the SQLite module into the correct location?