PSDevOps icon indicating copy to clipboard operation
PSDevOps copied to clipboard

Start-ADOBuild BulkRun

Open antdimot opened this issue 2 years ago • 4 comments

Hi,

I created a small powershell script which is able to run a set of Azure Devops Pipeline based on a csv file with required parameters. As devops its very usefull for me. Take a look bulkrun.

antdimot avatar Nov 30 '22 15:11 antdimot

@antdimot this is a nifty little script.

Are you suggesting updates to Start-ADOBuild?

StartAutomating avatar Nov 30 '22 23:11 StartAutomating

@StartAutomating yes I think you can integrate this feature.

antdimot avatar Dec 01 '22 08:12 antdimot

@antdimot this can already be done in a fairly PowerShell happy way, via the magic of the object pipeline and ValueFromPipelineByPropertyName.

It would be a bit easier with different column names, and a different column format.

Import-Csv .\Builds.csv |
   Start-ADOBuild -Organization Org -Project Project -DefinitionName { $_.Definition } -Parameters {
       $params = [Ordered]@{}
       foreach ($kv in -in $_ -split ';') {
            $k, $v = $kv -split '=', 2
            $params[$k] = $v
       } 
       $params
   }

If you wanted to modify Start-ADOBuild slightly to automatically convert some forms of strings in parameters to use this format, we could. Otherwise, I think it "works" mostly out of the box.

Sorry to take a bit to get back, I am sometimes slow to point out the ways a request is already accommodated / easy to accommodate.

If you feel strongly that Start-ADOBuild should work the way I've mentioned, please re-open the issue and re-title it.

StartAutomating avatar Dec 09 '22 22:12 StartAutomating

@StartAutomating I agree with you because your solution it's flexible.

antdimot avatar Dec 10 '22 10:12 antdimot