In my previous post I had a script that creates the application. Everything looked fine but when trying to install SCCM could not find the source so it was thinking it was locally availble. Although I added content to the application it was missing content. Reason was that the object did not create a reference to the application. So the following lines should also be added to add content to the deployment type.
$newContentref = New-Object Microsoft.ConfigurationManagement.ApplicationManagement.ContentRef $newContentref.ID = $newApplicationContent.Id $newDeploymentType.Installer.InstallContent = $newContentref