Chapter 23. Creating a GUI tool, part 1: the GUI

 

In this chapter and the two after it, we’re going to show you how to use PowerShell to build a graphical user interface (GUI) application, suitable for distribution to end users. Note that there’s no way to compile this into an executable that doesn’t need PowerShell in order to run, but we’ll be able to make this look a lot like a real Windows application.

Before writing this chapter, we thought long and hard about what directions to take, because when it comes to building a GUI we have several. We decided to use Windows Forms (WinForms), one of two .NET Framework GUI systems. We also decided, for the most part, to rely on a commercial tool named PowerShell Studio (http://primaltools.com) to build this GUI application. We won’t belabor the reasons behind those decisions here; we’d rather get on with the task at hand. But you should understand our reasoning and your other options, so we’ve written a brief appendix to this book, which you’ll find online at http://www.manning.com/LearnPowerShellToolmakinginaMonthofLunches. There we explain the different choices we were faced with and why we went the way we did. We realize that there’s a financial investment with PowerShell Studio, but we assume most of our readers are IT professionals working in a corporate environment, where presumably there’s a budget for tools to do your job.

23.1. Introduction to WinForms

23.2. Using a GUI to create the GUI

23.3. Manually coding the GUI

23.4. Showing the GUI

23.5. Lab

sitemap