title: Using PowerShell to write a file in UTF-8 without the BOM
body: <p><code>Out-File</code> seems to force the BOM when using UTF-8:</p>
  <pre><code>$MyFile = Get-Content $MyPath
  $MyFile | Out-File -Encoding &quot;UTF8&quot; $MyPath
  </code></pre>
  <p>How can I write a file in UTF-8 with no BOM using PowerShell?</p>
  <h3>Update 2021</h3>
  <p>PowerShell has changed a bit since I wrote this question 10 years ago. Check multiple answers below, they have a lot of good information!</p>