appveyor / secure-file

MIT License
26 stars 19 forks source link

secure-file not loaded correctly #1

Open Lerik opened 8 years ago

Lerik commented 8 years ago

I installed secure-file successfully in my vs project. But when I runthe command to encrypt a file, I get the next error message:

PM> secure-file\tools\secure-file -encrypt <file-path> -secret MYSECRET1234
secure-file\tools\secure-file : The module 'secure-file' could not be loaded. For more information, run 
'Import-Module secure-file'.
At line:1 char:1
+ secure-file\tools\secure-file -encrypt <file-path> -secret MYSECR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (secure-file\tools\secure-file:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule

As the error message suggests, I decided to run Import-Module secure-file, and this is what I got:

PM> Import-Module secure-file
Import-Module : The specified module 'secure-file' was not loaded because no valid module file was found in any 
module directory.
At line:1 char:1
+ Import-Module secure-file
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (secure-file:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Does anybody have an idea on why this is happening and what can I do?

FeodorFitsner commented 8 years ago

Are you running it from PowerShell?

Lerik commented 8 years ago

No, I'm running it from Package Manager Console

FeodorFitsner commented 8 years ago

Try running "dir" to see what's in current directory. Try running it as .\secure-file\tools\secure-file.

Lerik commented 8 years ago

I ran "dir" and all the project folders of my solution were listed, also the .nuget folder, two config files, and the snl file of my solution.

I ran the second option you gave me but it threw me an error message:

The term '.\secure-file\tools\secure-file' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

FeodorFitsner commented 8 years ago

Why not to use it outside Visual Studio, from a regular command line?

Lerik commented 8 years ago

Nevermind. I found out what was happening. Nuget installs every package inside a folder named lib, but that folder is not inside the folder of my solution, it's in the outside.

/lib
/my-solution/

So that was my problem. Now I have to run the command this way:

..\lib\secure-file\tools\secure-file -encrypt <path> -secret MYSECRET1234

That solves my problem. Thanks for your help @FeodorFitsner

01gucci1985 commented 7 years ago

Ok