title: Check if string is in list of strings
body: <p>Context:
  We are making an API to get a list of all VMs and the filter it, using if loops, to return only VMs with name starting only with the values in <code>$MachineList</code>.</p>
  
  <p>The list of servers is split in 2:</p>
  
  <ul>
  <li>set 1: srv-a-1, srv-a-2, srv-b-1, srv-b-2, srv-c-1, srv-c-2, etc.</li>
  <li>set 2: tst-a-1, tst-a-2, tst-b-1, tst-b-2, tst-c-1, tst-c-2, etc.</li>
  </ul>
  
  <p>This is the script:</p>
  
  <pre><code>$EnvironmentList = "Environments-4" -or "Environments-5" -or "Environments-41" -or "Environments-61"
  $MachineList = "srv-a*" -or "srv-b*" -or "srv-c*" -or "srv-d*" -or "srv-e*" -or "srv-f*" -or "srv-g*" -or "srv-h*" -or" srv-i*" -or "srv-j*" -or "srv-k*" -or "srv-l*"
  
  function CheckService {
      $MachinesRequest = (Invoke-WebRequest -Method Get -Headers @{"X-system-ApiKey"="Hashed-API-Key-Value"} -URI https://url-to-site.local/api/machines/all).Content | ConvertFrom-Json
      foreach ($Machine in $MachinesRequest) {
          if ($EnvironmentList -contains $Machine.EnvironmentIds) {
              if ($MachineList -contains $Machine.Name) {
                  $Machine.Name
              }
          }
      }
  }
  
  CheckService
  </code></pre>
  
  <p>We're trying to return just the items which match the values in the machine list however this is returning the full list of machines (both srv* and tst*).</p>