There are plenty of commercially available systems for synchronizing the contents of two folders (I’ve used Allway Sync a bit and it works well). But what if you just want to quickly sync a folder (and sub-folders) to another location using PowerShell?
Ideally I’d want it to take a source folder and synchronize it to a target folder with any missing content being recreated. If the target folder is already populated, I’d want to update any newer versions of the files and remove anything that has been deleted from the source.
The script (and a breakdown on how it works) follows after the line.
Update : I’ve revisited this script a few times with new additions and modifications.The latest full version of the script is here. That post also includes links covering the other revisions to the script.
Continue reading “PowerShell: Synchronizing a Folder (and Sub-Folders) Part 1”