Cloud: Adding a messagebox to your Powershell

In case you have a long acting action, you might want to have a message sent to you or a messagebox pop up.  Only use the message box when you are preforming testing.  Better yet, use logging early and often in your design.  This is just an example that I did to show myself, Powershell is just another way to implement Windows Programming, or something like that.

To use the messagebox, powershell can call the standard messagebox from the namespace, and use it just like you would in Visual Studio.  It can also implement the various buttons just as you would expect.

[System.Windows.Forms.MessageBox]::Show("Long Term action has completed." , "What's up")

If you are using the  Powershell ise, which is installed by default on Windows 7 and Windows 8, your screen will look like the following:

image

That’s it.