POWERSHELL: # Assumes Windows PowerShell, use -Encoding utf8BOM with PowerShell Core. For multiple files:
FIRST SOLUTION:
$files = Get-ChildItem c:\Folder1\ -Filter *.txt
foreach ($file in $files) {
Get-Content $file.FullName | Set-Content "E:\Temp\Destination\$($file.Name)" -Encoding utf8BOM
}
OR, SECOND SOLUTION (for multiple files):
get-item C:\Folder1*.* | foreach-object {get-content -Encoding utf8BOM $_ | out-file ("C:\Folder1" + $_.Name) -encoding default}
OR, THE THIRD SOLUTION: (only for 2 files)
$a = "C:/Folder1/TEST_ro.txt"
$b = "C:/Folder1/TEST_ro-2.txt"
(Get-Content -path $a) | Set-Content -Encoding UTF8BOM -Path $b