Convert all files to UTF-8 using powershell The article provides a PowerShell script named `Convert-Encoding.ps1` that converts files (specifically `.aspx`, `.master`, and `.cs` files) to UTF-8 without a Byte Order Mark (BOM). The script excludes certain directories and file patterns (like `**Debug**`, `**bin\**`, and `*.Designer.cs`) and uses `System.Text.UTF8Encoding` to rewrite each file's content in UTF-8 encoding. Convert-Encoding.ps1 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 Show hidden characters encrypt files to utf-8 no bom string $Excludes = @ ' Debug ', ' bin\ ', ' TemporaryGeneratedFile .cs', ' .Designer.cs' Get-ChildItem . -recurse -Include .aspx, .master, .cs -Exclude $Excludes | ForEach-Object { $content = $ | Get-Content $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False $ .Fullname System.IO.File ::WriteAllLines $ .Fullname, $content, $Utf8NoBomEncoding }