#requires -Version 1 $title = 'Question' $message = 'Do you want to do somthing?' $yes = New-Object -TypeName System.Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes', 'yes, yes I do.' $no = New-Object -TypeName System.Management.Automation.Host.ChoiceDescription -ArgumentList '&No', 'No no no' $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no) $result = $host.ui.PromptForChoice($title, $message, $options, 1) switch ($result){ 0 {'You selected Yes.'} 1 { 'You selected No.'} }