Currently I am working on rewriting all my VBscript and Powershell GUI script using WPF (Windows presentation platform). When building a graphical xaml forms on Visual studio as shown earlier on Part 1: Create WPF Xaml Powershell Gui form with Visual studio, I had to remove many elements manually by finding them, and every time it is not productive at all, if I missed removing any unwanted element, it was causing errors. To illustrate it, earlier I was removing lots of stuff from XAML form, But in this demo I will remove only 2 Lines 'x:Class="WPFapplication2.MainWindow"' and 'mc:Ignorable="d"'. This is one time process.
Line 24 and 25 are same earlier shown article Part 2: Powershell and WPF: Build GUI applications tutorial, Next line 28 is important one. Once XAML form is parsed by finding nodes and shows the list of allcontrols. Using Foreach-Object I can create a variable for each control so it can be used to perform actions. I don't have to worry about adding new FindName method everytime, it is automated now.
Userful Articles Part 1: Create Wpf Xaml Powershell GUI form with Visual studio Part 2: Powershell and WPF: Build GUI applications tutorial COOL POWERSHELL FREE ONLINE GUI GENERATOR TOOL, POSHGUI Generate random password GUI using powershell