title: PowerShell - Overwriting line written with Write-Host
body: <p>I'm trying to overwrite a line in PowerShell written with Write-Host (I have a process that's running in a loop and I want to show percentage updated on the screen). What I've tried to do is this:</p>
  
  <pre><code>Write-Host -NoNewline "`rWriting $outputFileName ($i/$fileCount)... $perc%"
  </code></pre>
  
  <p>but instead of overwriting the line it stays on the same line and appends to it.</p>
  
  <p>what am I missing here?</p>
  
  <p>Thanks</p>