In this post I will show you a quick way to create your own Powershell GUI.
I have rebuild a tool that I have already shared on my blog : Microsoft EXE extractor that I have done using "PrimalForms Community Edition".
In order to build the GUI i used Visual Studio 2012.
Some explanations about XAML and WPF
Why WPF and not Windows Forms
- WPF is easy to create
- WPF design is better
- Possibility to reuse your old code
- WPF is newer
More informations about WPF between Windows Forms
Build the GUI with Visual Studio
- Select "New project"
- Select "WPF applications"
|Choose WPF applications|
- Select all controls you want in the side bar
- In the below part you can see the appropriate XAML code
How to link the XAML and the PS1 script ?
- The first step is to load the XAML from your PS1, as below :
- Remove the "x:Class" part from you XAML at the first line.
In order to manipulate your controls with the ps1 you have to name them in the xaml file.
You just have to add x:Name="button_test" to your control, as below :
- <RadioButton x:Name="test" Content="test"/>
- $button_test= $Form.findname("button_test")
- Powershell v2
- Powershell v3
- Powershell v4
- Windows 7 x86
- Windows 7 x64
You can find in the below rar file the new Microsoft EXE exctrator tool.
You can extract the content in order to get the XAML and PS1 files.
|Download the Tool|