Use existing .ps1 file with form in script

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.
This topic is 6 years and 7 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
User avatar
Bantum
Posts: 3
Last visit: Mon Sep 13, 2021 3:40 am

Use existing .ps1 file with form in script

Post by Bantum »

Hi, I'm new to PowerShell Studio. I've got existing PowerShell scripts (.ps1) that I've included form controls to gather and display data. How can I bring these into PowerShell Studio so I can turn the form portion of the script into a .psf file for easy updating, etc? This would effectively import the ps1 file and turn it into a form project.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Use existing .ps1 file with form in script

Post by jvierra »

There is no way to convert a PS1 form into a PSF form. You will have to rebuild your form in PSS. Give it a try. It is not that hard. Add all controls and events then copy your PS1 event code to the correct events. A little debugging and you are set.
This topic is 6 years and 7 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