Get-ChildItem . -recurse -File -filter *.txt* | % {[System.IO.File]::WriteAllLines is used instead of the more commonly used Out-File because the latter outputs UTF8-BOM instead of plain UTF.
$MyFile = Get-Content -Raw $_.Fullname
$MyPath = $_.Fullname
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
No comments:
Post a Comment