In PowerShell version 3.0 and newer this is simply done this way:
Get-ChildItem -Path $sourceDir | Copy-Item -Destination $targetDir -Recurse -Container
Reference: Get-ChildItem
In PowerShell version 3.0 and newer this is simply done this way:
Get-ChildItem -Path $sourceDir | Copy-Item -Destination $targetDir -Recurse -Container
Reference: Get-ChildItem