Skip to content

Instantly share code, notes, and snippets.

@vegetaz
Forked from jamesfdickinson/Convert-Encoding.ps1
Created April 19, 2019 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vegetaz/91a144bf6599774e3e0939b45cc53024 to your computer and use it in GitHub Desktop.
Save vegetaz/91a144bf6599774e3e0939b45cc53024 to your computer and use it in GitHub Desktop.
Convert all files to UTF-8 using powershell
Param (
[Parameter(Mandatory=$True)][String]$SourcePath
)
Get-ChildItem $SourcePath\* -recurse -Include *.json,*.html,*.xml,*.js,*.txt,*.css | ForEach-Object {
$content = $_ | Get-Content
Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment