I ended up just redoing the entire script line by line and initiating the install locally and it now works, but it would be useful if the kit produced a log to troubleshoot when we receive a 6008 error.
The problem is if you’ve got a syntax error of some kind that’s impacting the script before Open-ADTSession is even called, not much we can do about it.
I assume you’ve been testing using the exe? In a single word: don’t. Test from PowerShell directly by invoking the script and if there’s an issue due to syntax or something else, the error will be right there in the console for you.
In the 3.x version, I added code my front script to handle errors that occurred before AppDeployToolkitMain.ps1 got to load. I’m going to need it in my v4.x fork so I’ll work on that tomorrow.
From the PSADT side, we’ve got to balance how complex we make Invoke-AppDeployToolkit.ps1 otherwise the file could be overwhelming to the point it alienates new users.