Victor Vogelpoel

Excellence is in the details


PowerShell: Compare-Directory.ps1 – comparing file contents and directories with Compare-Object and MD5 hash

In a after-site-deployment scenario, I needed to compare site directories and files on front-ends in a load-balanced web server farm to make sure these sites contained identical files and directory structure. When a hotfix was applied by an administrator, once too often files were not deployed properly and behavior of the site was not consistent because of the differences in file or configuration on front-ends. To diagnose these kind of problems more quickly, I developed PowerShell command Compare-Directory to compare a reference directory with one or more difference directories.
Continue reading