Hello. I'm user a powershell script that prompts for multiple entries and certain entries require a user to input a particular value. What I would like to do is if the user's input is not equal to those values, re-prompt the user to enter the entry again until they do enter the correct value. So for example one input asks for a Y or N if email will be forwarded.
$WillMail = read-host "Will mail be forwarded? Enter Y or N "
Ideally if the entry is something other than "Y" or "N", I'd like it to ask something like "That is an incorrect value. Please enter Y or N".