This looks backwards:
while ($userinput -notcontains $selections) You want it like this:
while ($selections -notcontains $userinput) You probably also want to do a case-insensitive comparison. In this case, since you only need to match a couple of basic ascii characters, it's as simple as using ToUpper() once on the initial input:
$userinput = Read-Host -Prompt $initpromptquestion becomes:
$userinput = (Read-Host -Prompt $initpromptquestion).ToUpper() Just be in mind there are situations where the basic ToUpper() or ToLower() are not good enough.
You may also want to .Trim() or add a [0] on the end, to only look at the first character if they enter something longer. But in my mind, that's still a failure.
after this portion is done, the code stops after this.
Well, yeah. We don't see any other code. You'd have to show how this is invoked in order to get help there. But at a guess, the problem is the return statements in the switch are breaking out of the entire file. You could use return if this was its own method or function, but it looks more like this is part of a longer section of code in one place.
Put it all together like this:
# Inital message to ask user what they would like to do $initpromptquestion = "What would you like to do?`n`n A) Collect new baseline.`n`n B) Begin monitoring files with saved baseline.`n`nSelect 'A' or 'B'" $errormessage = "Invalid entry. Please select 'A' or 'B'." $selections = @('A','B') $userinput = (Read-Host -Prompt $initpromptquestion).ToUpper() while ($selections -notcontains $userinput) { Write-Host $errormessage -ForegroundColor DarkRed -BackgroundColor White } $userinput = (Read-Host -Prompt $initpromptquestion).ToUpper() }