title: How to retrieve a recursive directory and file list from PowerShell excluding some files and folders?
body: <p>I want to write a PowerShell script that will recursively search a directory, but exclude specified files (for example, <code>*.log</code>, and <code>myFile.txt</code>), and also exclude specified directories, and their contents (for example, <code>myDir</code> and all files and folders below <code>myDir</code>).</p>
  
  <p>I have been working with the <a href="http://technet.microsoft.com/en-gb/library/hh849800.aspx"><code>Get-ChildItem</code></a> CmdLet, and the <a href="http://technet.microsoft.com/en-us/library/hh849715.aspx"><code>Where-Object</code></a> CmdLet, but I cannot seem to get this exact behavior.</p>