Last active
December 1, 2020 20:17
-
-
Save JeremyTBradshaw/79f826015653369e5e901bcb4b5cbb30 to your computer and use it in GitHub Desktop.
This file contains 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
#Requires -Version 5.1 | |
using namespace System.Management.Automation.Host | |
switch ( | |
$host.UI.PromptForChoice( | |
"Caption (e.g. 'XYZ has come up!')", | |
"Message (e.g. 'How would you like to proceed?", | |
[ChoiceDescription[]]@( | |
[ChoiceDescription]::new('&Proceed', 'Help message'), | |
'&Abort', | |
'&Suspend' | |
), | |
0 # Default choice | |
) | |
) { | |
0 { <# Proceed #> } | |
1 { <# Abort #> } | |
2 { <# Suspend #> } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment