Search notes:

System.Windows.Forms.MessageBox (class)

PowerShell example

The following simple PowerShell example tries to demonstrate a MessageBox with a Yes and No button:
add-type -assemblyName System.Windows.Forms

$res = [System.Windows.Forms.Messagebox]::Show(
    "Do you feel like it?",
    "Choose wisely"       ,
    [System.Windows.Forms.MessageBoxButtons]::YesNo
)

if ($res -eq [System.Windows.Forms.DialogResult]::Yes) {
  write-output "Go for it!"
}
else {
  write-output "You should reconsider your decision."
}
Github repository .NET-API, path: /System/Windows/Forms/MessageBox/yes-or-no.ps1

See also

Create a Message Box with PowerShell

Index