Here is a simple script I wrote which was inspired by this post on terminal color highlighting and by ColorDiff that does essentially the same thing.
# Out-ColorDiff.ps1Process { if ($_) { foreach ($line in $_) { if ($line -match '^[<|-]') { Write-Host -ForegroundColor red $line } elseif ($line -match '^[>|+]') { Write-Host -ForegroundColor green $line } else { Write-Host $line } } }}
Here is a screenshot of sample output from the script:
You can use it by piping the diff output to the script, like 'svn diff somefile | out-colordiff' or if you're stuck using something like MKS, you can use 'si diff somefile | out-colordiff'.
Possible (and easy) additions would be to add direct parsing of a file instead of taking an argument off of the pipeline. This is all I need currently, but if you wish to add more features, feel free to leave them in the comments.
Page rendered at Tuesday, December 02, 2008 10:55:18 AM (Central Standard Time, UTC-06:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.