title: Does powershell string manipulation adds junk character?
body: <p>When i am placing my $string variable contents into some text file, it adds some junk character it seems. For example i am writing an utility name in string and copy that string to file like follows.</p>
  
  <pre><code>$CodeCount+="ccount.exe"
  
  $CodeCount | Out-file "C:\CodeCount.bat"
  </code></pre>
  
  <p>When i am executing this batch file , it fails by showing some junk character in front.<img src="https://i.stack.imgur.com/koRVn.png" alt="enter image description here"></p>
  
  <p>Even i tried with trim() but still the same result.</p>
  
  <p>How to avoid adding Junk character in front?</p>