Powershell脚本批量转换文件编码

 foreach($file in Get-ChildItem -Path . -Filter *.h -recurse)
 {
		Write-Host "正在处理文件 : $file.FullName"
      
        $fileContent = Get-Content -Path $file.FullName
        $fileContent | Out-File -Encoding UTF8 -FilePath $file.FullName
        
 }

Leave a Reply