I have an Azure Devops build YAML file that contains the following task:
- task: PowerShell@2
displayName: 'Set coverage variable'
inputs:
targetType: 'inline'
script: Write-Host "##vso[task.setvariable variable=coverage]Get-Content .\coverage\lcov-report\summary.txt"
I would like this task to set the variable coverage to be the value of the contents of summary.txt. However, when accessing the variable in the following task, I see that the variable is literally the string Get-Content .\coverage\lcov-report\summary.txt.
There seems to be no example anywhere in the documentation as to how to pull this off. Is it just a limitation of scripting? Do I have to set the Get-Content command to a variable and then access that variable?