Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $DestDIR = 'C:Destination'
  2. $OrigDIR = 'C:Origin'
  3.  
  4. Get-ChildItem $DestDIR | ForEach-Object {
  5. $DestName = $_.Name
  6. $DestPath = $_.FullName
  7.  
  8. Get-ChildItem $OrigDir -Recurse | Where-Object {$_.Name -eq $DestName} | ForEach-Object {
  9. $OrigPath = $_.FullName
  10. Copy-Item $OrigPath $DestPath -Force
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement