v2kiran / PSLiteDB

PowerShell wrapper for LiteDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import-Module fails

MaxFalcone opened this issue · comments

Description

When I'm trying to import pslitedb module it fails with error

Import-Module : Could not load file or assembly 'LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9
f27' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1
+ Import-Module pslitedb
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

Steps to reproduce

  1. Install-Module PSLiteDB or Install-Module PSLiteDB -Scope AllUsers
  2. Import-Module PSLiteDB
  3. Error.

System info

Windows 10 or Windows Server 2019
Powershell 5
PSLiteDB 2.2.0

I changed the PSLiteDB.psd1 file and added explicit declaration of cmdlets, functions and aliases to be exported.
It works like this.

image

Thank you for reporting this.
Seems to be happening only with powershell 5 and not with powershell 7. I am guessing something changed with .net, anyway need to investigate this a little more.

I changed the PSLiteDB.psd1 file and added explicit declaration of cmdlets, functions and aliases to be exported. It works like this.

image

I’m getting as well, unfortunately your workaround didn’t work for me :(

Thanks @v2kiran , this seems to be fixed in Windows Powershell 5.1 with version 2.3.0 of the module.

@tylermiranda - welcome... forgot to mention that it was fixed in new version :) ...

install-module pslitedb -force