1. [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
  2.  
  3. $result = [Microsoft.VisualBasic.Interaction]::MsgBox
  4. ("Do you agree?", 'YesNoCancel,Question', "Respond please")
  5.  
  6. switch ($result) {
  7. 'Yes' { "Ah good" }
  8. 'No' { "Sorry to hear that" }
  9. 'Cancel' { "Bye..." }
  10. }

Last Updated (Wednesday, 13 May 2009 16:12)