Skip to content

Instantly share code, notes, and snippets.

@jamesfdickinson
Last active July 1, 2024 07:51
Show Gist options
  • Save jamesfdickinson/cc91d43b9fb369d6839c1b829a9756fd to your computer and use it in GitHub Desktop.
Save jamesfdickinson/cc91d43b9fb369d6839c1b829a9756fd 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