Posts

Showing posts from December, 2015
Comparing two files using powershell Hola todos,... as it said in the heading, this is about comparing two files using powershell, I will get down to business and explain few things : - normally two compare two files with powershell, there are two ways (which I know..) that we can use to do this, we can normally use the "Compare-object" CMDLET which was introduced by microsoft, this one can read the contents of both files and show you the difference in case there are some differences. if there are no differences it will show you nothing as a result (No prompts, messages or whatever..). - The other way which i used to do before i knew the "Compare-object" CMDLET is to get the "length" property of each file and just make a condition saying of both lengths are equal, show some message, else show another message. I will introduce both ways here : #The code start here # first code, using compare-object : $source = "D:\we\f1.