title: Powershell get childitem filename masks
body: <p>I'm working on a script that goes through folders with multiple .pdf-files in it. Only when the name of the file fits one of two masks, Powershell should continue executing certain steps. Else it should continue to search for the next file fitting the mask.</p>
  
  <p>I've used:</p>
  
  <pre><code>Get-ChildItem $PATH -Filter "*TEXT-TXT-*" -Recurse -Force |Foreach-Object {
  
          write-host $_.Name
  </code></pre>
  
  <p>But this filters only hardcoded. How to use a mask and preferable use two mask as filter? The masks should be:</p>
  
  <ul>
  <li>"##-##-#### XXXX-XXX-XXXX-XX.PDF"</li>
  <li>"##-##-#### XXXX-XXX-XXX-XXXX-XX.PDF"</li>
  </ul>
  
  <p>Where # are any numbers and X are any non-number characters. </p>
  
  <p>Hope this is possible.</p>