title: How to loop through files and rename using PowerShell?
body: <p>I would like to rename all the jpg files in a folder to uniform convention like Picture00000001.jpg  where 00000001 is a counter.</p>
  
  <p>It would be a walk in the park in C# but I would think this is the kind of bread and butter stuff that PowerShell was made for.</p>
  
  <p>I'm guessing something like</p>
  
  <pre><code>$files = ls *.jpg
  $i=0
  foreach($f in $files) { Rename-Item $f -NewName "Picture"+($i++)+".jpg" }
  </code></pre>
  
  <p>But before I hit the gas on this I would like to 1) format the counter, and 2) have some sense that this is in fact even a good idea.</p>
  
  <p>If this sounds more like OCD than a good idea please speak up.</p>