rohabu
6/5/2014 - 11:56 AM

Show MessageBox with Yes and No

Let the user choose between yes and no and work with the result

Add-Type -AssemblyName System.Windows.Forms

$MsgBoxResult = [System.Windows.Forms.MessageBox]::Show("Select Yes or No", "Window Title", "YesNo", "Information")

if ($MsgBoxResult -eq "YES" ) {
  Write-Host "Choice was YES"
}
else {
  Write-Host "Choice was NO"
}