I have a variable defined in my Python script task in Azure pipelines.
variable = "True"
I want to use this variable in the next task which is a Powershell script task.
How can I achieve this using Azure YAML pipelines?
Thanks!
I have a variable defined in my Python script task in Azure pipelines.
variable = "True"
I want to use this variable in the next task which is a Powershell script task.
How can I achieve this using Azure YAML pipelines?
Thanks!
Have you looked at Task Output Variables already? e.g.
steps:
- task: PythonScript@0
name: pythonTask
inputs:
scriptSource: 'inline'
script: |
someVar = "True"
print("someVar = " + someVar)
print("##vso[task.setvariable variable=someVar]" + someVar)
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "python var = $(someVar)"