May 27, 2009

Powershell Merge/Compare

How cool is powershell? Well, I needed to do a compare for some .config files in an automated process. I could use C#, but why not look towards a few lines and see what powershell can do. Sure enough, there is Compare-Object. This did not work as I expected and I instead did a quick google search and saw someone else who did this same thing: Powershell Merge

All I had to do was:
$a = Get-Content cachingDev.config
$b = Get-Content cachingProd.config
Compare-Object $a $b -SyncWindow 50
Yup, powershell is really that awesome.

No comments:

Post a Comment