IF they have the same name and content then I want to out-file it.
If they have the same name but different content ( see it by size) then I want to have an extra out-file
Greetz
This is what I Hav so far
[string]$folder01 = "C:\OLDDATA"
[string]$folder02 = "C:\Ebeling"
$child_folder02 = $(get-childitem $folder02 -Recurse)
Write-Host "SideIndicator FileName Path"
Write-Host "------------- ------------------------ ------------------"
Compare-object -ReferenceObject $(get-childitem $folder01 -Recurse) -DifferenceObject $(get-childitem $folder02 -Recurse) -includeequal -PassThru -Property Name | Sort-Object -Property Name | foreach {
# Process only files
if ($_.mode -notmatch "d") {
Write-Host $_.SideIndicator.toString().padright(15)$_.Name.tostring().padright(26)$_.FullName.tostring().padright(50)
if ($_.SideIndicator -match "==") {
$double_filename = $_.Name
$child_folder02 | foreach {
if ($double_filename -eq $_.Name) {
Write-Host " "$_.FullName
}
}
}
}
}