title: How can I exclude multiple folders using Get-ChildItem -exclude?
body: <p>I need to generate a configuration file for our Pro/Engineer CAD system. I need a recursive list of the folders from a particular drive on our server. However I need to EXCLUDE any folder with 'ARCHIVE' in it including the various different cases.</p>
  
  <p>I've written the following which works except it doesn't exclude the folders !! </p>
  
  <pre><code>$folder = "T:\Drawings\Design\*"
  $raw_txt = "T:\Design Projects\Design_Admin\PowerShell\raw.txt"
  $search_pro = "T:\Design Projects\Design_Admin\PowerShell\search.pro"
  $archive = *archive*,*Archive*,*ARCHIVE*
  
  Get-ChildItem -Path $folder -Exclude $archive -Recurse  | where {$_.Attributes -match 'Directory'}  | ForEach-Object {$_.FullName} &gt; $search_pro   
  </code></pre>