PrimalForms 2011 will ship with a number of predefined templates that will make things easier for you when creating a GUI for PowerShell.
(Fig 1: When you create a new form, a list of templates will appear.)
We know some of you will want to create your own reusable templates, so we implemented any easy way for you to convert your forms:
(Fig 2: Create Form Template Menu Option)
I want to the option to search the my exported database queries, but the default query form doesn’t support the functionality. So I start by creating a Form with the “Grid Template” and I add a text box and button labeled “Search”. I create a function to handle the search using the text from the text box. This function will be called when the “Search” button is pressed.
Next I add a special token, so that I can determine where the Grid Query Function will be called and placed. In this case, I want the query function to be called when I press the “Query” button.
Once I am satisfied with my form, I press the “Create Form Template” button and the following dialog appears:
(Fig 3: Create Form Template Dialog with Thumbnail of Form Template)
A thumbnail of the form is displayed along with a few required fields. I name my template and select “Grid Template” as the type. I need to select the “Grid Template” type so that my new template is used for exporting for WMI and Database Query Forms. Otherwise if I select “Form Template” it will be used as a template for normal Forms. Next I provide a short description of the template which will be displayed with the template. Finally I press the “Save” button and I’m done.
Next time I export a Query Form, the new template will appear as an option.
(Fig 4: New Template is displayed when Exporting a Query Form)