When using automated software to build/deploy solutions, they typically look at either the stderr stream or the return value of the script (zero or non-zero) to decipher whether the job succeeded or failed. When PackageWeb fails for whatever reason, the stderr stream isn't written to and/or the response returns zero. An easy fix for this is to call the "edit" PS command whenever an error occurs. For example:
More info to this.. Apparently when you make some PS method calls (e.g. New-Item, etc), they don't throw exceptions unless you add the "-ea stop" argument to it.
When using automated software to build/deploy solutions, they typically look at either the stderr stream or the return value of the script (zero or non-zero) to decipher whether the job succeeded or failed. When PackageWeb fails for whatever reason, the stderr stream isn't written to and/or the response returns zero. An easy fix for this is to call the "edit" PS command whenever an error occurs. For example:
Write-Host "Exiting with code 12345" exit 12345