Reordering steps using power shell

Is there any way to reorder the deployment steps given in process using automated power shell script?


Thanks for getting in touch!

This is definitely possible. I don’t have a specific code sample for you, but as a starting point, have a look at this Powershell example. This example shows how you would add a new step to a deployment process. The line I have highlighted (Line 31) is the most relevant line, in which the new step is simply added to the $process.Steps collection.

Similarly, if you are interested in reordering steps then you also need to make changes to this same $process.Steps collection - specifically you want to reordered the steps that are within that collection. The type of $process.Steps is an IList<DeploymentStepResource> (see here), so all of the usual IList methods are available to help you reorder the steps.

Once they are reordered you would invoke $repository.DeploymentProcesses.Modify($process) to save your changes (as in the example provided above).

Hope that helps, let me know if you have any further questions,


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.