Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $DestDIR = 'C:Destination'
- $OrigDIR = 'C:Origin'
- Get-ChildItem $DestDIR | ForEach-Object {
- $DestName = $_.Name
- $DestPath = $_.FullName
- Get-ChildItem $OrigDir -Recurse | Where-Object {$_.Name -eq $DestName} | ForEach-Object {
- $OrigPath = $_.FullName
- Copy-Item $OrigPath $DestPath -Force
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement