This exercise will explore the use of PromptForChoice to limit selections in a script. Following this exercise, you will explore using Try...Catch...Finally to detect and to catch errors.
Exploring the PromptForChoice construction
Open the Windows PowerShell ISE.
Create a new script called PromptForChoiceExercise.ps1.
Create a variable to be used for the caption. Name the variable caption and assign a string value of This is the caption to the variable. The code to do this appears here:
$caption = "This is the caption"
Create another variable to be used for the message. Name the variable message and assign a string value of This is the message to the variable. The code to do ...