Rename-item in multiple subfolders
<p>I have a piece of software which looks for a files named "report.txt". However, the text files aren't all named report.txt and I have hundreds of sub folders to go through.</p>

<p>Scenario:</p>

<pre><code>J:\Logs
26-09-16\log.txt
27-09-16\report270916.txt
28-09-16\report902916.txt
</code></pre>

<p>I want to search through all the sub folders for the files <code>*.txt</code> in <code>J:\logs</code> and rename them to <code>report.txt</code>.</p>

<p>I tried this but it complained about the path:</p>

<pre><code>Get-ChildItem * |
Where-Object { !$_.PSIsContainer } |
Rename-Item -NewName { $_.name -replace '_$.txt ','report.txt' }
</code></pre>