Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- Get-ChildItem -Path $source -Recurse -Force |
- Where-Object { $_.psIsContainer } |
- ForEach-Object { $_.FullName -replace [regex]::Escape($source), $destination } |
- ForEach-Object { $null = New-Item -ItemType Container -Path $_ }
- Get-ChildItem -Path $source -Recurse -Force |
- Where-Object { -not $_.psIsContainer } |
- Copy-Item -Force -Destination { $_.FullName -replace [regex]::Escape($source), $destination }
- }
- catch
- {
- Write-Host "$_"
- }
Add Comment
Please, Sign In to add comment