Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 28. Creating and Running PowerSh... > Creating a PowerShell Message Box

Creating a PowerShell Message Box

There may be times when you want to provide feedback to the user in a message box, or even get some response from a user with a message box. This is relatively easy to do. The following script shows basic syntax to create a message box, and then check to see what button the user clicked:

$obj = new-object -comobject wscript.shell
$intButton = $obj.popup("Do you want to continue?",0,"A question for
you", 4)
If ($intbutton -eq 6)
    { write-host "User pressed yes" }
elseif ($intbutton -eq 7)
    { write-host "User pressed no" }


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint