Back to articles
January 24, 2025
azureDevOps, create pipelines, powershell

Powershell loop to create AzureDevOps pipelines

$pipeline_names = $("pipeline1", "pipeline2")$environment_name = 'test_environment'$branch = 'master'
cd C:\\repo\directory
foreach ($pipeline in $pipeline_names) { 
  az pipelines create --name ${pipeline}-deployment 
    --description "Deploy ${pipeline} into ${environment_name}" 
    --repository ${repo_name} 
    --repository-type tfsgit 
    --branch ${branch} 
    --yml-path ${pipeline}\${environment_name}\pipeline.yaml }
Loading comments...