I am trying to copare files and directories. I want to first ensure that all of the same files are there, and then do some type of comparrison without having to hash all of the files. Both folders have the same structures, and should be very similar. I am however afraid that someone has modified only one directory or folder. Any help is greatly appreciated.
$FirstPath = "\\Server001\c$\Files"
$SecondPath = "\\Server002\c$\Files"
$firstcomp = Get-ChildItem -Recurse –Path $FirstPath
$Secondcomp = Get-ChildItem -Recurse –Path $SecondPath
Compare-Object -ReferenceObject $firstcomp -DifferenceObject $Secondcomp
I am comparing approx 10 Gb of files.
I do not even know what is the best way to accomplish the 2nd part of this because I keep recieving errors for files that do not exist in the first part of this.