

Most of these properties you can set or change in the Forms editor (we will get to that later). And as you know, each object has a set of properties and methods.Ī button for example has properties for it’s size, location, text, color and a lot more. Well, WinForms GUI elements are also objects. If you have been using Powershell for at least a little while, you should be used to working with objects. So for this and the upcoming articles, we will focus on WinForms. But for the purpose of creating a GUI for your administrative script or a nice and convenient little tool for your users, WinForms will do just fine: You usually won’t have the time to create a fancy design anyway and if you really want to, you can do a few nice things with WinForms too.

That’s a huge advantage, because you simply click your GUI-elements together and immediately get your ready-to-use Powershell code. And for WinForms, there are WYSIWYG-Editors available, which generate native Powershell code. With WPF you got the full freedom of design, but the downside is that it’s way more complicated to use than WinForms, especially for beginners. The practical differences however, are that with Windows Forms you will use the native Windows interface elements and you will have only limited control on how things will look like. I wont bother you with the technical differences (they are well explained here if you’re interested). You can either use Windows Forms (WinForms) or Windows Presentation Foundation (WPF). If you want to create a GUI for your Powershell script, you’ve got two options.
