PowerShell Beautifier is a free module that formats code, making it easier to read and validate. It re-indents code with spaces or tabs, cleans and rearranges all whitespace within a line. It also replaces aliases with cmdlet names, replaces parameter names with proper casing, fixes case for [types], etc.
This PowerShell code snippet searches through each subfolder within the specified directory and copies all files to the target. While doing so, if any file already exist in the destination directory, it would rename the duplicate file by appending a number – which is automatically incremented – before the extension.