Out-File with no BOM

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche

Change Encoding of a Textfile

$MyFile = Get-Content $MyPath
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines($MyPath, $MyFile, $Utf8NoBomEncoding)