The Basics of MessageBox in PowerShell

A MessageBox is a small dialog box that provides information to users or prompts them for a response. In PowerShell, creating a MessageBox is straightforward. Here’s a basic script to get you started:

messageBox
$Message = "Fin de configuration. Merci de fermer la session"
$Title = "Information"
$Button = "OK" #Value => OK OKCancel YesNo YesNoCancel
$Icon = "Information" #Value => Asterisk Error Exclamation Hand Information None Question Stop Warning
$DefaultButton = "None" => Default result $Button
$result = [System.Windows.MessageBox]::Show($Message,$Title,$Button,$Icon,$DefaultButton)

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.