DevOps | Scripts | Automation

PowershellWPF

Create GUI with WPF in PowerShell – Part I

In the previous article, we have seen what is the WPF framework and if you missed reading the article then click the link below.

In this article, we will learn how to create the first GUI using WPF PowerShell and we will display a simple form. To fulfill our requirements, we need Visual Studio. If you don’t have a visual studio then you can download it from the below link.

https://visualstudio.microsoft.com/downloads/

There are 3 versions of visual studio. Community, Professional, and Enterprise. The second and third version is not free version but WPF can be created using the community edition as well. Download the community edition if you don’t have the license for VS and while installing make sure to select WPF (.Net Framework).

Once you have downloaded VS version, create a new Project and select WPF (.Net Framework or .Net Core).

Next, Select Name of the Project, Solution Name and Location of the project.

Once you are done creating a new project, VS will open a project window. Their descriptions are as below.

In the above image, you can see the XAML code window. Whatever you add/modify in the GUI windows, the same will be updated in the XAML code.

In the second part, we will learn how to use the above XAML code into PowerShell and display the GUI.