Good Morning,
I am currently working on a utility script and someone has written a PowerShell Module that includes several functions that I want to take advantage of in my utility.
I have added the .psm1 and .psd1 files into the project folder and added them as "existing" files in the project.
I have also imported the module into the cache and rebuilt the cache.
However, I am unable to change the Build and Shared properties on the file.
I would like to be able to package the module alongside the script so that I dont have to provide the module to other users.
What is the correct procedure for including powershell modules into a forms project?
Importing PS Module into Project
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.
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.
Re: Importing PS Module into Project
jvierra,
Thanks for the reply. I was hoping to package this into an EXE not an MSI.
Looks like my only choice is to either import the functions from the 3rd party module or create an MSI.
Thanks again for the help.
Thanks for the reply. I was hoping to package this into an EXE not an MSI.
Looks like my only choice is to either import the functions from the 3rd party module or create an MSI.
Thanks again for the help.
Re: Importing PS Module into Project
You can add the module folder to the project as an external folder and then explicitly import it using the path.
Import-Module $PsScriptRoot\TheModule
You would have to copy the folder and the exe to the target. You can also place all of this on a share and allow users to run it from the share.
Import-Module $PsScriptRoot\TheModule
You would have to copy the folder and the exe to the target. You can also place all of this on a share and allow users to run it from the share.