Here's the script for some peer review. Let me know if I could have done it better.
$sourceServer = ""
$destinationServer = ""
$existingPackages = Get-CMDeploymentPackage -DistributionPointName $destinationServer
$dpPackages = Get-CMDeploymentPackage -DistributionPointName $sourceServer
$Error.Clear()
foreach($dpPackage in $dpPackages){
if($dpPackage.PackageID -in $existingPackages.PackageID){Write-Host -ForegroundColor Green "Package $($dpPackage.PackageID) already exists" ;continue}
Write-Host -ForegroundColor Yellow "Adding package $($dpPackage.PackageID)"
switch ($dpPackage.ObjectType)
{
0 {'Software Distribution Package';Start-CMContentDistribution -DistributionPointName $destinationServer -PackageId $dpPackage.PackageID}
3 {'Driver Package';Start-CMContentDistribution -DistributionPointName $destinationServer -DriverPackageId $dpPackage.PackageID}
4 {'Task Sequence Package';Start-CMContentDistribution -DistributionPointName $destinationServer -TaskSequenceId $dpPackage.PackageID}
5 {'Software Update Deployment Package';Start-CMContentDistribution -DistributionPointName $destinationServer -DeploymentPackageId $dpPackage.PackageID}
6 {'Device Setting Package';Start-CMContentDistribution -DistributionPointName $destinationServer -PackageId $dpPackage.PackageID}
7 {'Virtual Package';Start-CMContentDistribution -DistributionPointName $destinationServer -PackageId $dpPackage.PackageID}
257 {'Operating System Images Package';Start-CMContentDistribution -DistributionPointName $destinationServer -OperatingSystemImageId $dpPackage.PackageID}
258 {'Boot Image Package';Start-CMContentDistribution -DistributionPointName $destinationServer -BootImageId $dpPackage.PackageID}
259 {'Operating System Install Package';Start-CMContentDistribution -DistributionPointName $destinationServer -OperatingSystemInstallerId $dpPackage.PackageID}
512 {'Software Distribution Application';
$app = Get-CMApplication | Where-Object {$_.PackageID -eq $dpPackage.PackageID}
Start-CMContentDistribution -DistributionPointName $destinationServer -ApplicationId $app.CI_ID
#change to distribution point group name?
#start-CMContentDistribution -ApplicationID $app.CI_ID -DistributionPointGroupName “$ServerName”
}
Default {"Unknown"}
}
#if($Error){break}
}