Hello,
Thank you for your followup on this.
And when I try to import-module it doesn't find it and throws an error like you listed.
In your first thread, you mentioned that you are using a PowerShell script to copy the files into the right directory, am I right?
If so, could you please forward me a copy of the .AIP file that you are using to build your project so I can further investigate it?
From the tests that I've performed yesterday when I posted the reply, the error was caused by the file redirection.
In order to install the modules, I have recreated the file hierarchy in the
"Files and Folders" page, like this:
- FolderHierarchy.png (121.45KiB)Viewed 2312 times
The
ProgramFiles folder can be resolved, at install time, into two folders:
C:\Program Files --> if the process is of 64-bit type
C:\Program Files (x86) --> if the process is of 32-bit type on a 64-bit machine
Therefore, our path to the modules could either be:
Code: Select all
C:\Program Files\WindowsPowerShell\Modules
or
Code: Select all
C:\Program Files (x86)\WindowsPowerShell\Modules
If you manually open the directories, you will notice that both of them have the
"WindowsPowerShell\Modules" folder.
Additionally, as you may know, PowerShell comes in two versions - 32-bit one and respectively 64-bit one (on a 64-bit machine).
What I have noticed is the following:
If you install the modules in the 64-bit folder (e.g. C:\Program Files\WindowsPowerShell\Modules) and then open the 32-bit PowerShell and try to get the module, you will get the error specified in my first thread.
The same happens the other way around (if you install it in the 32-bit folder and then open the 64-bit PowerShell, trying to import the module)
I think that this might have happened on your machine as well.For instance, if your package type is of 32-bit and the PowerShell used to copy the files is of 32-bit, chances are that your files were copied on the
"Program FIles (x86)" folder. Therefore, when trying to import the modules from a 64-bit instance of PowerShell, the error is thrown.
Hope this explanation helps.
Looking forward to hearing from you.
Best regards,
Catalin