title: replace names of all directiories and files in PS
body: <p>I want to replace all space characters into "_" in names of all subfolders and files.
  Unfortunately when I type:</p>
  
  <pre><code>Get-ChildItem -recurse -name | ForEach-Object { Rename-Item $_ $_.replace(" ","_") }
  </code></pre>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Rename-Item : Source and destination path must be different. At line:1
    char:60
    + Get-ChildItem -recurse -name | ForEach-Object { Rename-Item &lt;&lt;&lt;&lt;  $_ $<em>.replace(" ","</em>") }
        + CategoryInfo          : WriteError: (PATH_HERE) [Rename-Item], IOException
        + FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.RenameItemCommand</p>
  </blockquote>
  
  <p>How I should improve this short code?</p>