Chapter 7. Building GUI Applications in PowerShell

When Jeffrey Snover was showing PowerShell (then Monad) around Microsoft, one of the responses he received was, “A new command line? Snover, what about Windows don’t you get?” In fact, Windows Server 8 is all about not running graphical user interfaces (GUIs). It can be run as a headless server.

Note

Want to follow along with the examples in this chapter? Download ShowUI and you can try out the examples as you go: http://showui.codeplex.com/.

ShowUI is a PowerShell module to help build WPF user interfaces in script. It makes the complicated world of WPF easy to use in PowerShell. You can use ShowUI to write simple WPF gadgets, quick frontends for your scripts, components, and full applications.

Why a Chapter About GUIs?

So why a whole chapter devoted to GUIs, you ask? Great question! First off, GUIs are optimal in many scenarios. For example, sometimes users want to see a list of information that has several attributes. They don’t want to see those details whizzing by on the console; they want to capture it in a screen to be able to vertically and horizontally scroll through it.

The challenge with GUIs comes when users need to do a task over and over, clicking through a number of screens, entering info, clicking some more, type, click, type, clickety, click, click. They’re out!

Ultimately, as developers we need to deliver what the user wants, and that deliverable is sometimes a GUI. Being the lazy coder, I like to get my job ...

Get Windows PowerShell for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.