<# .NOTES -------------------------------------------------------------------------------- Code generated using by: Visual Studio Created on: 26 June 2018 4:57 AM Get Help on: http://vcloud-lab.com Written by: Kunal Udapi Build & Tested on: Windows 10 Purpose: This script is an example of styling Font on textbox. -------------------------------------------------------------------------------- .DESCRIPTION GUI script generated using Visual Studio 2017 #> #Load required libraries Add-Type -AssemblyName PresentationFramework, PresentationCore, WindowsBase, System.Windows.Forms, System.Drawing [xml]$xaml = @" Sample text bold, italic and underlined words. Text with blue and Magenta highlight and Cyan color "@ #Read the form $Reader = (New-Object System.Xml.XmlNodeReader $xaml) $Form = [Windows.Markup.XamlReader]::Load($reader) #AutoFind all controls $xaml.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object { New-Variable -Name $_.Name -Value $Form.FindName($_.Name) -Force } #Mandetory last line of every script to load form [void]$Form.ShowDialog()