v2kiran / PSLiteDB

PowerShell wrapper for LiteDB
MIT License
52 stars 6 forks source link

Import-Module fails #15

Closed MaxFalcone closed 2 years ago

MaxFalcone commented 2 years ago

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

MaxFalcone commented 2 years ago

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

image

v2kiran commented 2 years ago

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.

tylermiranda commented 2 years ago

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 :(

tylermiranda commented 2 years ago

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

v2kiran commented 2 years ago

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

install-module pslitedb -force