Page 1 of 1

Include scripts in PowerShell GUI project

Posted: Tue Sep 17, 2019 6:29 am
by timstspry17
Hello, I would like to know if in a PowerShell project you can include other scripts in like the form_load event? I would like to include a couple of scripts in the same directory as my powershell project and have their functions available to the form project like this:

.\getsomeinformation.ps1
.\getmoreinfo.ps1

so on and so forth.

Thanks!
Tim

Re: Include scripts in PowerShell GUI project

Posted: Tue Sep 17, 2019 11:01 am
by jvierra
Yes. Have you tried this in your form? Any scripts or modules can be loaded.
You need to use the script home folder and use the full path to the script.

Re: Include scripts in PowerShell GUI project

Posted: Wed Sep 18, 2019 4:14 am
by timstspry17
Thank you for this information. Yes, I had tried it in my form project, but didn't use the full path to the scripts. This information is helpful, thanks so much!

Tim