Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secure-file not loaded correctly #1

Open
Lerik opened this issue Aug 31, 2016 · 7 comments
Open

secure-file not loaded correctly #1

Lerik opened this issue Aug 31, 2016 · 7 comments

Comments

@Lerik
Copy link

Lerik commented Aug 31, 2016

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
Copy link
Member

Are you running it from PowerShell?

@Lerik
Copy link
Author

Lerik commented Aug 31, 2016

No, I'm running it from Package Manager Console

@FeodorFitsner
Copy link
Member

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

@Lerik
Copy link
Author

Lerik commented Aug 31, 2016

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
Copy link
Member

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

@Lerik
Copy link
Author

Lerik commented Aug 31, 2016

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
Copy link

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants