Skip to content

Instantly share code, notes, and snippets.

@mshock
Created October 8, 2012 20:29
Show Gist options
  • Save mshock/3854782 to your computer and use it in GitHub Desktop.
Save mshock/3854782 to your computer and use it in GitHub Desktop.
Powershell diff
# emulate Unix diff command w/ Powershell script
# usage: ps_diff.ps1 red_fish.txt blue_fish.txt [logpath]
$diff = compare-object (get-content $args[0]) (get-content $args[1])
if ($args[2] -eq $null) {write-output $diff}
else {add-content $args[2] $diff}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment