tag:help.appveyor.com,2012-11-13:/discussions/questions/49318-green-deployment-despite-failed-webconfig-updateAppVeyor: Discussion 2022-03-15T18:58:58Ztag:help.appveyor.com,2012-11-13:Comment/485000162020-07-31T04:35:44Z2020-07-31T04:35:44ZGreen Deployment Despite Failed Web.config Update<div><p>Hi Attila,</p>
<p>If the last command in PowerShell script was successful (even a single <code>Write-Host</code>) then the entire script is considered to be successful - this is how PS works by default. Could it be your case? Is there another command after <code>$webconfig.Save()</code>?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/485000162020-07-31T13:56:12Z2022-03-15T18:58:58ZGreen Deployment Despite Failed Web.config Update<div><p>Hi Feodor,<br>
I think we are talking about two different things.</p>
<p>The previously posted image clearly shows that an Exception occurred. AppVeyor's engine does recognize this exception and displays it as red.</p>
<p>I believe, since this exception is now known to the AppVeyor's engine, it <strong>should be indicated</strong> to the user so the user, just by looking at the deployment list, be aware of it.<br>
See this newly attached image which shows everything is green = the user thinks all deployments went well. This is misleading.</p>
<p>I am not arguing about how PS works or should work, I am saying/suggesting that this behavior of AppVeyor should be looked at from a usability standpoint and changed so that the user can find deployment errors much easier.</p>
<p>Thanks,<br>
Attila</p></div>akozmatag:help.appveyor.com,2012-11-13:Comment/485000162020-07-31T17:24:35Z2020-07-31T17:24:35ZGreen Deployment Despite Failed Web.config Update<div><p>Try adding this to the top of your <code>deploy.ps1</code> script to see if that helps:</p>
<pre>
<code>$ErrorActionPreference = 'Stop'</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/485000162020-08-03T13:41:26Z2022-03-15T18:58:58ZGreen Deployment Despite Failed Web.config Update<div><p>Hi Feodor,</p>
<p>Thank you. We will try it.<br>
Best,<br>
Attila</p></div>akozma