Using SAPIEN PowerShell Studio
In the previous section, we discussed how we can utilize WinForms to give a frontend to our scripts. But doing it manually is really painful. To build a simple tool such as the one we have built, we had to write 421 lines of code. We can simplify all these with the use of PowerShell Studio 2015 by SAPIEN. SAPIEN earlier had a free community edition Primal Forms, which has since been discontinued. PowerShell Studio 2015 is a paid version, but if you create a lot of GUIs using WinForms in PowerShell, then this is an invaluable tool for you. It comes with a 45-day trial period so that you can try it before making the final decision. Without wasting much time, let's start the discussion about building a GUI using this tool.
We will start by creating a New Form Project:
We give it the name TextBox_PStudio
:
This gives us a blank form:
On the left-hand side, we can see that there is a Toolbox option. There are all kinds of control and control sets available in Toolbox...