title: PowerShell - How to check a string to see if it contains another string with wildcard?
body: <p>I want to go through a list of files and check if each filename match any of the string in a list. This is what I have so far, but it is not finding any match. What am I doing wrong?</p>
  
  <pre><code>$files = $("MyApp.Tests.dll","MyApp.Tests.pdb","MyApp.dll")
  $excludeTypes = $("*.Tests.dll","*.Tests.pdb")
  
  foreach ($file in $files) 
  {
      $containsString = foreach ($type in $ExcludeTypes) { $file | %($_ -match '$type') }
  
      if($containsString -contains $true)
      {
          Write-Host "$file contains string."
      }
      else
      {
          Write-Host "$file does NOT contains string."
      }
  }
  </code></pre>