Created
September 24, 2013 14:26
-
-
Save kimsk/6685593 to your computer and use it in GitHub Desktop.
Saving multiple files in a folder recursively as UTF-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I do that only for a .txt files?