Can Powershell on Windows 7 diff two files on the hard drive?
Sometimes a text compare is helpful, but otherwise just telling whether a file is identical to another file is helpful. thanks.
Update:
on UNIX, it is
diff file1.dat file2.dat
On Powershell, if I create file1.txt, containing the content "hello" and copy this file to file2.txt, and type
diff file1.txt file2.txt
the result is
InputObject SideIndicator
----------- -------------
file2.txt =>
file1.txt <=
if I change the content of file2.txt to "hello world" and diff again, the result of diff'ing is the same.
Best Answer
Edit: Apparently there is a built in alias so this works too:
You can do this:
This is some sample output:
You can also do -excludeDifferent to only show the lines that are the same or -includeEqual to include the lines that are the same.