The scripts seems to be hard coded to use the web application associated with the Portal type. We want to use another web application.
Create a Project Server DB
$portalWebApp = $xmlinput.Configuration.WebApplications.WebApplication | Where {$_.Type -eq "Portal"} | Select-Object -First 1