Issues with Adding Modules to Powershell Multi Forms Application

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
Locked
Justin.Resor
Posts: 2
Joined: Tue Sep 18, 2018 6:46 am

Issues with Adding Modules to Powershell Multi Forms Application

Post by Justin.Resor » Tue Sep 18, 2018 8:00 am

I am trying to write a simple gui that connects to office 365. I have all the code to actually make the connection but i am having issues importing all of the modules that I need such as MSOnline, ActiveDirectory, and AzureAD. Also as a note i am going to deploy this to a few users when finished so if there is a way to package the application with the modules making a standalone application that would be good advise as well.

I receive an error for each of the modules above stating "The specified module was not loaded because no valid module file was found in any module directory." I have the import statements in my MainForm.psf file in the $mainform_Load.

Can someone please point me in the right direction?

I am able to import the modules to a native PowerShell window and connect to office 365(They are installed on my PC).

I am using Powershell Studio 2018.

Justin.Resor
Posts: 2
Joined: Tue Sep 18, 2018 6:46 am

Re: Issues with Adding Modules to Powershell Multi Forms Application

Post by Justin.Resor » Tue Sep 18, 2018 8:23 am

I have resolved the issue of the modules not importing correctly. This is my newness to Sapien Studio coming out...There is a box in the upper left hand corner of Powershell Studio 2018 that lets you select the PSVersion. I had it set to PowerShell version 2 64bit...Once I set it to V5-64bit everything started working.

I still would like information about packaging the modules with the application for deployment.

Thanks for any help you can provide.

Locked