TFS Deployer is not showing deployment failures


It use to be that TFS Deployer would send an email out with "Failure" in the subject whenever some output from the PowerShell script executing wrote to standard error. We are running the latest version of TFS Deployer and this doesn't seem to be happening anymore. Even when there are failures in the deploy, the email comes through as "Success". The only time I have noticed that we get the "Failure" email now is when a script runs past its timeout value and TFS Deployer kills the script. Is this how TFS Deployer is suppose to work now or is this a bug? Thanks!


jstangroome wrote Sep 1, 2013 at 11:35 PM


This is an expected change in TFS Deployer's behaviour.

Earlier versions of TFS Deployer would execution scripts using a custom PowerShell Host implementation in a seperate AppDomain. This provided some level of isolation between scripts but environment variables and working directories, among other process-level items were shared. The custom host implementation also introduced behaviour not demonstrated by powershell.exe (eg running native apps) and also complicated script development and testing.

The latest version of TFS Deployer runs scripts in a separate process and uses the same Microsoft.PowerShell.ConsoleShell implementation as powershell.exe. This provides better isolation and scripts run much more similarly to how they would in powershell.exe

Detecting script failure is no longer based on writing to stderr or using Write-Error but upon the exit code of the process. As such, any script action that would cause powershell.exe to exit with a non-zero exit code (eg "throw", "-ErrorAction Stop", and others) should appear as a failure to TFS Deployer too.