Created
January 21, 2020 11:35
-
-
Save manualbashing/177fe1bcb284d059230cea316411203e to your computer and use it in GitHub Desktop.
[Yes / No User choice] #powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $options = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No") | |
| [int]$defaultchoice = 1 | |
| $option = $host.UI.PromptForChoice($Title, $Info, $Options, $defaultchoice) | |
| switch($option) | |
| { | |
| 0 { Write-Host "Yes – Write your code"} | |
| 1 { Write-Host "No – Write your code"} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment