Thank you for this code. I modified it so that I could use the result from the dialog box. This is all I had to do:
$result = ([Windows.Forms.MessageBox]::Show(“$message”, “$title”, [Windows.Forms.MessageBoxButtons]::$Option, [Windows.Forms.MessageBoxIcon]::$Type,$WhichButtonHasFocus,$OnTop))
Write-Host $result
Then I can use the $result for whatever I like.