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.
Locked
User avatar
jt0821
Posts: 2
Joined: Tue Mar 13, 2018 5:28 am

Using "Preview GUI" for Pre-Existing Script

Post by jt0821 » Tue Mar 13, 2018 5:52 am

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?

User avatar
jvierra
Posts: 12673
Joined: Tue May 22, 2007 9:57 am
Contact:

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

Post by jvierra » Tue Mar 13, 2018 8:52 am

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
Joined: Tue Mar 13, 2018 5:28 am

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

Post by jt0821 » Tue Mar 13, 2018 9:47 am

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?

User avatar
jvierra
Posts: 12673
Joined: Tue May 22, 2007 9:57 am
Contact:

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

Post by jvierra » Tue Mar 13, 2018 9:52 am

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.

Locked