Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Using PowerShell to write a file in UTF-8 without the BOM
- $MyFile = Get-Content $MyPath
- $MyFile | Out-File -Encoding "UTF8" $MyPath
- $MyFile = Get-Content $MyPath
- $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False)
- [System.IO.File]::WriteAllLines($MyPath, $MyFile, $Utf8NoBomEncoding)
Advertisement
Add Comment
Please, Sign In to add comment