title: How to rename unknown filename to new filename
body: <p>There is a file with an unknown name being placed into a folder (name could be <code>4444444-542323442.txt</code> or <code>3234234234.txt</code> or similar). Whenever it is coming in, the existing one is deleted, therefore there is the only one txt file in the folder all the time.  I would like to change the name to like <code>newname.txt</code>.</p>
  
  <p>I tried this:</p>
  
  <pre><code>Get-Childitem -Path C:\logsTop1\*.txt |
    Rename-Item -NewName {$_.Name -replace ".txt","newname.txt"}
  </code></pre>
  
  <p>but I checked the txt file in the folder the name is like this <code>3234234234newname.txt</code>.</p>
  
  <p>It added, I would like to just rename to <code>newname.txt</code>.</p>
  
  <p>How can I do that?</p>