Sergey Aldoukhov
Sergey Aldoukhov

Reputation: 22744

Looking for a PowerShell script to compare two folders recursively

Just thought it would be nice to have one but my PS skills are not up to task. Anybody can share theirs?

Upvotes: 12

Views: 11680

Answers (1)

Richard
Richard

Reputation: 108975

Easy enough to do something simple:

$d1 = get-childitem -path $dir1 -recurse
$d2 = get-childitem -path $dir2 -recurse
compare-object $d1 $d2

More sophistication required depending on the definition of difference.

Upvotes: 15

Related Questions