Created
November 3, 2017 14:27
-
-
Save kinoh/2be714ff562fca56988a1372d7fc7195 to your computer and use it in GitHub Desktop.
Give BOM to all the source files.
This file contains 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
foreach($i in Get-ChildItem -Recurse) { | |
if ($i.PSIsContainer) { | |
continue | |
} | |
# You might need some more pattern | |
if ($i.FullName -like "*.cc" -or $i.FullName -like "*.h") { | |
echo $i.FullName | |
$tmp = $i.FullName + ".tmp" | |
get-content -Encoding UTF8 $i.FullName | set-content -Encoding UTF8 $tmp | |
remove-item $i.FullName | |
move-item $tmp $i.FullName | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment