title: Validate against an array
body: <p>I'm trying to setup a validation check against an array. I have the following</p>
  
  <pre><code>$ValidDomain = "*.com","*.co.uk"
  $ForwardDomain = Read-Host "What domain do you want to forward to? e.g. contoso.com"
  #while (!($ForwardDomain -contains $ValidDomain)) {
  while (!($ValidDomain.Contains($ForwardDomain))) {
      Write-Warning "$ForwardDomain isn't a valid domain name format. Please try again."
      $ForwardDomain = Read-Host "What domain do you want to forward to? e.g. contoso.com"
  }
  </code></pre>
  
  <p>The commented <code>while</code> line is just an alternative way I've been testing this.</p>
  
  <p>If I enter, when prompted by <code>Read-Host</code>, "fjdkjfl.com" this displays the warning message rather than saying it's valid and keeps looping.</p>
  
  <p>I have tried using <code>-match</code> instead of <code>-contains</code> but get the message:</p>
  
  <blockquote>
    <p>parsing "*com *co.uk" - Quantifier {x,y} following nothing.</p>
  </blockquote>
  
  <p>Have I got this completely wrong?</p>