Formatting T-SQL Scripts using ScriptDOM and PowerShell

Well-formatted scripts are always easier to maintain and enhance readability to high degree. Formatting standards are an important part of coding standards anywhere and if not, they need to be. If there are a large number of scripts this can add up to a significant amount of time needed to maintain them. It is also not something that can be done entirely for the sake of cosmetic value. Even if one chooses to format lots of scripts, it can take considerable time and patience. Having a tool that can format scripts without altering any other content can be really useful.