Module failing to import

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
proshot78
Posts: 14
Last visit: Wed Aug 09, 2023 3:39 pm
Answers: 1
Has voted: 3 times

Module failing to import

Post by proshot78 »

I have a project that has been built and installed via a MSI. When running in Powershell studio, the program can access and use a custom module I created, but when I run the installed program I get the resulting error:
  1. Import-Module:
  2. Line |
  3.   76 |      Import-Module .\Common\UserToolsFunctions.psm1
  4.      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5.      | C:\Program Files (x86)\My Project\User Account Tools\Modules\PSDiagnostics\PSDiagnostics.psm1
Here's the code that attempts to load the module:
  1. Import-Module .\Common\UserToolsFunctions.psm1
The error doesn't seem particularly useful for debugging purposes, anyone have any ideas?
by proshot78 » Sat May 28, 2022 8:54 pm
Fixed by removing module and placing functions in startup.pss
Go to full post
proshot78
Posts: 14
Last visit: Wed Aug 09, 2023 3:39 pm
Answers: 1
Has voted: 3 times

Re: Module failing to import

Post by proshot78 »

Fixed by removing module and placing functions in startup.pss
This topic is 1 year and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked