When you have a predefined set of options like this, consider using a multiple-choice menu, like this:
$title = "Select Fruit"
$prompt = "Which fruit is your favorite?"
$apple = New-Object System.Management.Automation.Host.ChoiceDescription "&Apple","Apple"
$melon= New-Object System.Management.Automation.Host.ChoiceDescription "&Melon","Melon"
$mango= New-Object System.Management.Automation.Host.ChoiceDescription "Man&go", "Mango"
$options = [System.Management.Automation.Host.ChoiceDescription[]]($apple, $melon, $mango)
$selectedFruit = $host.ui.PromptForChoice($title, $prompt, $options, 0)
switch($selectedFruit)
{
0 {Write-Host "You chose Apple"}
1 {Write-Host "You chose Melon"}
2 {Write-Host "You chose Mango"}
}
In the ISE, the user will see a GUI prompt, with buttons to click on, and at the console, a menu with specific allowed letters to select (A, M and G in this case).
This method has the benefit that it looks like a typical prompt from PowerShell and will check and re-prompt if the user enters an invalid value. You can add a 'quit' option, so the user has an easy way to skip all options.
$s
variable for two different types? Why not just1 { 'Apple' }
... ?