Part of a script I'm working on uses Read-Host to get user password for an access account. Then it tests if it can use that account to gain access to a particular host. All was great till it was decided that the account should not exist on certain hosts. To deal with that I was thinking of giving whoever runs the script the option to say 'No' so when it get's detected the whole part of code that does the access test get's skipped. Not sure if this is the best solution but should be simple enough for whoever runs the script.
I was expecting something like Case statemnt so I can say
Select Case $pass
Case "No" 'do nothing
run the test code
How would I go about this sort of problem in Powershell?