Skip to content

Instantly share code, notes, and snippets.

@hanson-andrew
Created February 14, 2013 02:01
Show Gist options
  • Save hanson-andrew/4950084 to your computer and use it in GitHub Desktop.
Save hanson-andrew/4950084 to your computer and use it in GitHub Desktop.
Powershell line ending normalizer
Get-ChildItem * -Recurse -Include *.php,*.css,*.js | ForEach-Object {
$wholeFile = [IO.File]::ReadAllText( $_.FullName )
if ($wholeFile -match "`r[^`n]")
{
$content = Get-Content $_.FullName
$content | Set-Content $_.FullName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment