title: PowerShellscript, bad file encoding conversation
body: <p>I have a PowerShell script for the conversation of file character encoding.</p>
  
  <pre><code>Get-ChildItem -Path D:/test/data -Recurse -Include *.txt |
  ForEach-Object {
    $inFileName = $_.DirectoryName + '\' + $_.name
    $outFileName = $inFileName + "_utf_8.txt"
    Write-Host "windows-1251 to utf-8: " $inFileName -&gt; $outFileName  
    E:\bin\iconv\iconv.exe -f cp1251 -t utf-8 $inFileName &gt; $outFileName
  }
  </code></pre>
  
  <p>But instead of utf-8 it converts file character encoding into utf-16. When I invoke the iconv utility from command line it works fine.</p>
  
  <p>What do I wrong?</p>