Below is the variable declaration and power shell script I've written to update the build variable at queue new build
Declaration:
Power shell script:
$fileData = Get-Content -Path C:\builds\agent\PreviousRevisionUpdate.txt
$temp=$fileData[1]
##vso[task.setvariable variable=ActualRevision;]$temp
Write-Host "$temp - $env:ActualRevision"
Output:
2018-02-06T15:29:19.6035251Z ##[section]Starting: Actual Build Number Update
2018-02-06T15:29:19.6035251Z ==============================================================================
2018-02-06T15:29:19.6035251Z Task : PowerShell
2018-02-06T15:29:19.6035251Z Description : Run a PowerShell script
2018-02-06T15:29:19.6035251Z Version : 1.2.3
2018-02-06T15:29:19.6035251Z Author : Microsoft Corporation
2018-02-06T15:29:19.6035251Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
2018-02-06T15:29:19.6035251Z ==============================================================================
2018-02-06T15:29:19.6095263Z ##[command]. 'C:\builds\agent\_work\_temp\dd262af4-0863-4f8d-a14e-1d9ea50b4c72.ps1'
2018-02-06T15:29:20.1186281Z 11 - 1
2018-02-06T15:29:20.1386321Z ##[section]Finishing: Actual Build Number Update
From above output it's still showing variable value as '1' instead of '11'.
Next task - Update assembly info -> where I'm not getting updated value.
Am I missing anything?? Please help me out.