Rename and archive databases to name _old and move the datafiles and tr log files to old subfolder

Sometime the application installation want to create the same databases with the same data files.
In this case we need to rename them and move another folder not to update.

This PowerShell script renames two local SQL Server databases (database1 and database2),
Closes active connections with SINGLE_USER, detaches, moves their files to an “old” subfolder in their current location,
Reattaches them. All PowerShell output and commands are logged to Documents\log.