Thursday, 10 December 2015

Compare Directory with Powershell no Winmerge required

Windows Power shell has a built in compare-object function. This is very handy for common tasks like comparing directorys.

Here is a simple script to compare file directory


$Dir1 = Get-ChildItem -Recurse -path C:\fso

$Dir2 = Get-ChildItem -Recurse -path C:\fso_BackUp

Compare-Object -ReferenceObject $Dir1 -DifferenceObject $Dir2

No comments:

Post a Comment