Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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.'}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement