Skip to content

Instantly share code, notes, and snippets.

@kimsk
Created September 24, 2013 14:26
Show Gist options
  • Save kimsk/6685593 to your computer and use it in GitHub Desktop.
Save kimsk/6685593 to your computer and use it in GitHub Desktop.
Saving multiple files in a folder recursively as UTF-8
$files = Get-ChildItem 'c:\temp' -Recurse | ? {Test-Path $_.FullName -PathType Leaf}
foreach($file in $files)
{
$content = Get-Content $file.FullName
$content | Out-File $file.FullName -Encoding utf8
}
@guipborges
Copy link

How can I do that only for a .txt files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment