A very nice little bit of code. You could probably go to town on this one and set up SSIS packages to load the output file and then a nice SSRS report to clearly display discrepancies in data between two instances as I suspect the text file can get quite difficult to read if there are lots of differences to compare.
But I think what this clearly demonstrates is the ease at which PowerShell can be used to help with otherwise mundane tasks, and is a very valuable tool in any DBA's toolkit.
Thanks!