- Comparing folders and content with PowerShell
- $Folder1 = Get-childitem "C:Folder1"
- $Folder2 = Get-childitem "C:Folder2"
- Compare-Object $Folder1 $Folder2 -Property Name, Length | Where-Object {$_.SideIndicator -eq "<="} | ForEach-Object {
- Copy-Item "C:Folder1$($_.name)" -Destination "C:Folder3" -Force
- }