Compare folder structures and report differences

I have a large amount of folders from which the data needs to be copied into a new folder structure.

before I start, I would like to compare each folder with the new structure and report the differences.

I am not interested in the files, only the folders.

is there a way to achieve this ?

February 6th, 2015 2:24pm

Maybe something like this:

$Source = Get-ChildItem -Path 'Source' -Directory -Recurse
$Destination = Get-ChildItem -Path 'Dest' -Directory -Recurse
Compare-Object $Source $Destination -PassThru | Select Fullname,SideIndicator

Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 4:29pm

This looks good, thanks.

There is one complication. 

Several folders from the source already have a new destination folder assigned. these should not appear in the comparison list.

example:

x:\data\folder1\01-abc should be mapped to x:\data\folder1\0001-abc
x:\data\folder1\02-abc should be mapped to x:\data\folder1\0002-abc
x:\data\folder1\03-abc should be mapped to x:\data\folder1\0002-abc

So basically only a list of folders should be shown (exported to csv/xls) which do not match with the folders of the comparison list. this list is a csv file which contain both source and destination folders.

Is there a way to achieve that ?



February 9th, 2015 5:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics