Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell recursive copy skip if file already exists

$Source = "C:SourceFolder"
$Destination = "C:DestinationFolder"

Get-ChildItem $Source -Recurse | ForEach {
    $ModifiedDestination = $($_.FullName).Replace("$Source","$Destination")
    If ((Test-Path $ModifiedDestination) -eq $False) {
        Copy-Item $_.FullName $ModifiedDestination
        }
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #powershell #recursive #copy #skip #file #exists
ADD COMMENT
Topic
Name
8+5 =