visual-studiopowershellazure-devopsrelease-management

Running PowerShell script on VSTS deployment group


I am configuring a deployment group phase inside my release definition at VSTS.

I added a PowerShell script task that is supposed to start a process (.exe console app) on the target machine.

I have tested the PowerShell script manually on the target PC and it is working great:

start-process -filepath c:\myfolder\myprogram.exe

But when the release runs, the script seems not to be working. It executes properly but my process is not initiated.

There is no error message on the release log.

How can I fix that?


Solution

  • The deployment group agent must be running as Interactive mode. Article: Configure the agent

    1. Download agent (Agent queues admin page> Click Download agent)
    2. Run Command Line as administrator
    3. Run .\config.cmd --machinegroup command
    4. Specify Server URL, PAT token, Project Name, Deployment Group Name, Agent name
    5. Press Enter (N) when it asks if you want to run the agent as a service
    6. Call .\run.cmd to start agent
    7. Modify release definition, specify that deployment group for Run on deployment group.