A
A
asdz2018-01-21 23:16:38
Team Foundation Server
asdz, 2018-01-21 23:16:38

What is the best way to execute a powershell script in a release definition?

Before deploying the artifact, the release definition needs to run a PS script of about 1000 lines to prepare the deployment environment. How to run such a script correctly? In the script launch task, it is impossible to inline a script of this size. Pre-host this script on the build server? Won't it be fragile and uncomfortable way? I still include this deployment script in the artifact (when building, the script is pulled from the corresponding tfs repository and included in the artifact, then it is executed by the agent after receiving the artifact), but I don’t like the solution either, because when the deployment environment changes, the script will not execute correctly (for example, if we want to deploy a two-week old artifact), and this script has already been updated and is not suitable, but it is not the latest version in the artifact. In general,

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question