-
Notifications
You must be signed in to change notification settings - Fork 7
Import-Module fails on default install using EXE installer #77
Comments
@ji438937 Can you share more about your environment? On what version of Windows and Powershell is this? Also which version of the installer did you use? |
Installer -
OS -
PowerShell (tested on 2 versions) -
|
@ji438937 When installing the module, the installer should update a system environment variable called 'PSModulePath' and add an entry to the installation path of the module. This allows the module to get loaded implicitly without you doing an import. Can you check if that has happened? You can check that from the environment variables panel, or by typing You can get the list of all installed modules by typing |
I think I found the issue. It appears that there's an extra '\' at the end of the path that causes the module not to be discovered. Changing the path from "C:\Program Files (x86)\Particular Software\NServiceBus.PowerShell" to "C:\Program Files (x86)\Particular Software\NServiceBus.PowerShell" and the module is discovered. The higher folder (Particular Software) could have other installations (e.g. ServiceControl management) which is why the installer operates on the inner folders. If you confirm that changing the path fixes the issue, I'll raise an issue to get it fixed. |
I got here by searching for:
any module directory. which I got after using module installer https://github.com/particular/NServiceBus.PowerShell/releases/tag/6.0.0 and running typical command I was able to get it installed on my machine just by using full path instead:
|
When installing the module via the EXE installer the
Import-Module NServiceBus.PowerShell
fails with the following error:This looks to be due to there not being a
.psm1
file in the module directory and thePSModulePath
that is added is direct to the module folder, instead of the parent directory path.PSModulePath
added by EXE installer:C:\Program Files (x86)\Particular Software\NServiceBus.PowerShell\
Workaround:
Add the module parent folder to
PSModulePath
:C:\Program Files (x86)\Particular Software\
The text was updated successfully, but these errors were encountered: