I am trying to compare files between two different folders and then if there are differences I would like to output it to a txt file. Right now I can show the differences but I am unable to write the results in the txt file.
Here is what I have so far:
foreach($file in dir)
{
$fileName = "c:\SPScripts\$file"
$fileName2 = "c:\SPScripts_02\$file"
compare-object -referenceobject $(get-content $FileName) $(get-content $FileName2) -property Name, $fileName, $fileName2, length
| Out-File "c:\Yo_02.txt" -append
}
Thanks!
Here is what I have so far:
foreach($file in dir)
{
$fileName = "c:\SPScripts\$file"
$fileName2 = "c:\SPScripts_02\$file"
compare-object -referenceobject $(get-content $FileName) $(get-content $FileName2) -property Name, $fileName, $fileName2, length
| Out-File "c:\Yo_02.txt" -append
}
Thanks!