title: Powershell switch statement with Name.Contains
body: <p>I have a series of files that need to be filtered before being added to a job queue. That job queue uses the file type as a parameter of a function. What I'm currently using is this:</p>
  
  <pre><code> foreach ($currentFile in $ListOfTestFiles)
   {
      if ($currentFile.Name.Contains("Test1"))
      {
          $ParameterSet="Type1,$SomeOtherVariable"
      }
      if ($currentFile.Name.Contains("Test2"))
      {
          $ParameterSet="Type2,$SomeOtherVariable"
      }
      if ($currentFile.Name.Contains("Test3"))
      {
          $ParameterSet="Type3,$SomeOtherVariable"
      }
      if ($currentFile.Name.Contains("Test4"))
      {
          $ParameterSet="Type4,$SomeOtherVariable"
      }
  
      $JobArray += Start-Job -ScriptBlock $func -ArgumentList $ParameterSet
      $JobArray | Receive-Job -Wait   
   }
  </code></pre>
  
  <p>Is there a way to slim this down with a switch statement?</p>