What is the recommended way when deploying to agent of starting an app from deploy.ps1?

javier's Avatar


23 Aug, 2018 07:36 PM

We have a simple dotnet core app being deployed via the AppVeyor Deployment Agent with a single ZIP artifact including:
 * before-deploy-ps1 script to kill the previous deployment of the app (this one is working fine)
 * deploy.ps1 script to start the app in the current deployment

We've tried multiple strategies in the deploy.ps1 script but none of them seem to work for different reasons:
 * `Start-Process` will start the process as a child which be killed when the host finishing executing the script
 * `cmd start` will block powershell and the deployment will not finish

We've read before that the recommended way is to transform into service which does not suit our current needs. Also if Windows Apps are supported there should be a supported way of doing it.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 23 Aug, 2018 07:48 PM

    Ilya Finkelshteyn's Avatar

    Can you try cmd /c start and let us know if this helps?

  2. 2 Posted by javier on 24 Aug, 2018 10:35 AM

    javier's Avatar

    Thanks Ilya.

    Just cmd /c start was blocking powershell .

    In the end the combination that made it work was:
    $job = Start-Job { param($command) cmd /k "$command" } -Arg $command where command is "start /d ..."

  3. Support Staff 3 Posted by Ilya Finkelshte... on 24 Aug, 2018 05:03 PM

    Ilya Finkelshteyn's Avatar

    Good, thanks a lot for sharing!

  4. Ilya Finkelshteyn closed this discussion on 24 Oct, 2018 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac