I'm trying to use a While Loop to prompt for a response. I want to force the person to type in one response or another. I can get this to work this way:
while ($favcolor -ne "blue") {$favcolor = Read-Host "What is your favorite color?"}
If the user types anything other than "blue", they get prompted again.
But when I try and use multiple options, it doesn't work.
while ($favcolor -ne ("blue" - or "green" -or "black")) {$favcolor = Read-Host "What is your favorite color?"}
I've tried several different ways of writing this but I can't seem to figure it out. Am I going about this the right way? Is there a better way to do it? I want to be able to have a list of acceptable answers and then use that variable later in the script.