PowerShell Files Counts and Compare Two Folders

PowerShell Files Counts and Compare Two Folders

PowerShell Files Counts and Compare Two Folders

$folder1 = “\\fs01\scans
$folder2 = “\\fs02\scans
$firstFolder = Get-ChildItem -Recurse $folder1
$firstFolder.Count
$secondFolder = Get-ChildItem -Recurse $folder2
$secondFolder.Count
Compare-Object -ReferenceObject $firstFolder -DifferenceObject $secondFolder

Comments are closed.