title: Renaming Files with PowerShell
body: <p>I need to rename a bunch of files at once in Windows PowerShell. I read the HTG article <a href="http://www.howtogeek.com/111859/how-to-batch-rename-files-in-windows-4-ways-to-rename-multiple-files/">here</a> and it helped a little.</p>
  
  <p>My problem is that It will only rename files in the top of the directory, nothing deeper. For example: There is FOLDER A and inside FOLDERA is a document and FOLDER B. Inside FOLDER B is another document. Both folders and both documents need to be renamed. The way it is working now is that FOLDER A, the document in FOLDER A, and FOLDER B are being renamed, but not the document inside FOLDER B.</p>
  
  <p>My current code is:</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace “ “,”_” }
  </code></pre>
  
  <p>Thanks for the help!</p>