How to get Pop up message box using Powershell

by Sitaram Pamarthi on October 19, 2010

AFAIK, there are two ways available to generate a Pop-up message box using powershell.

Simple way:-

In this powershell relies on a method which is available in windows shell object(WSH). In this you can control four factors, “Message box title”, “Message”, “timeout for message box”, “box type”.

Below is a simple example.

$a = new-object -comobject
$b = $a.popup(“This is a test message from “,0,”Test message from techibee”,1)

Second and effective method:-

In this we can make use of dotnet windows forms to generate the pop-up message boxes. Though code looks bit heavy it works very well and has lot of flexibility.

[Windows.Forms.MessageBox]::Show(“Test message from!. Subscribe to news letters, RSS feeds at to stay tuned”, “”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)

This post was written by...

– who has written 503 posts on

Sitaram Pamarthi is a windows administrators with 9+ years of more

Previous post:

Next post: