Out-File 似乎在使用UTF-8时强制BOM:
Out-File
$MyFile = Get-Content $MyPath $MyFile | Out-File -Encoding "UTF8" $MyPath
如何使用PowerShell以UTF-8编写没有BOM的文件?
powershell encoding byte-order-mark utf-8
byte-order-mark ×1
encoding ×1
powershell ×1
utf-8 ×1