Skip to content

Instantly share code, notes, and snippets.

@manualbashing
Created January 21, 2020 11:35
Show Gist options
  • Select an option

  • Save manualbashing/177fe1bcb284d059230cea316411203e to your computer and use it in GitHub Desktop.

Select an option

Save manualbashing/177fe1bcb284d059230cea316411203e to your computer and use it in GitHub Desktop.
[Yes / No User choice] #powershell
$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