Skip to content

Instantly share code, notes, and snippets.

@raymadrona
Forked from arebee/no-bom.ps1
Created May 2, 2018 06:32
Show Gist options
  • Save raymadrona/4c77e2311c31fb79c59c3ca32306483a to your computer and use it in GitHub Desktop.
Save raymadrona/4c77e2311c31fb79c59c3ca32306483a to your computer and use it in GitHub Desktop.
PowerShell script to save as UTF-8 without a BOM
gci . -recurse -filter *.ps* | % {
$MyFile = gc $_.Fullname -raw
$MyPath = $_.Fullname
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment