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
Include scripts in PowerShell GUI 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.
- timstspry17
- Posts: 45
- Last visit: Tue Apr 18, 2023 2:49 pm
Re: Include scripts in PowerShell GUI project
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.
You need to use the script home folder and use the full path to the script.
- timstspry17
- Posts: 45
- Last visit: Tue Apr 18, 2023 2:49 pm
Re: Include scripts in PowerShell GUI project
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
Tim