Windows Service Deployment Recovery Settings

Is there any way to set the windows service recovery options on deployment?

Hi Joshua,

You can do this by including a PostDeploy.ps1 script in your service package; the contents would be something like:

$serviceName = $OctopusParameters["Octopus.Action.WindowsService.ServiceName"]
& "sc.exe" failure $serviceName reset=360 actions=reboot

There’s a little more info on deployment scripts etc. at

Hope this helps,