We have all seen the message boxes pop up when we are working with forms, online applications, software installs, etc. Today I am going to go through the different types of message boxes available within PowerShell. There are a number of elements that we can use to get the best functionality from our message box.
First things first, we need to load in the Powershell Assembly:
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
We can get the message box to display any type of message we want, using static text or even have it show a variable or part of string.
Here is the Powershell code to create a simple message box:
[System.Windows.Forms.MessageBox]::Show("This is my first message box.")