Using "Preview GUI" for Pre-Existing 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 1 month 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
jt0821
Posts: 2
Last visit: Tue Dec 08, 2020 6:31 pm

Using "Preview GUI" for Pre-Existing Script

Post by jt0821 »

I apologize if this has been previously discussed, but I am unable to find any answers - I am trying to use the GUI Designer features of PowerShell Studio with a script/form I previously manually developed. I have not been able to accomplish this by creating a new form and then trying to preview it. Does PowerShell studio look for specific button, form, etc names? Is this even possible or do forms have to be created in PowerShell Studio from scratch?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Using "Preview GUI" for Pre-Existing Script

Post by jvierra »

PSF files are not scripts and PS1 files are not designable form files. You have to manually convert hand coded scripts to PSS forms. PSS cannot convert them.
User avatar
jt0821
Posts: 2
Last visit: Tue Dec 08, 2020 6:31 pm

Re: Using "Preview GUI" for Pre-Existing Script

Post by jt0821 »

Thanks - Any suggestions for manually converting them? Is there a guide, etc.? Or do I just need to create the same buttons, output windows, etc. and then copy the code from the PS1 script?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Using "Preview GUI" for Pre-Existing Script

Post by jvierra »

Use the designer to create a similar GUI and add the events and values as needed. Use the PS1 as a guide. There is no other way and no guide for doing this.
This topic is 6 years and 1 month 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