0

im just trying to do the simplest pipeline in the world.

# Starter pipeline # Start with a minimal pipeline that you can customize to build and deploy your code. # Add steps that build, run tests, deploy, and more: # https://aka.ms/yaml trigger: - main pool: vmImage: ubuntu-latest steps: - task: PowerShell@2 inputs: targetType: 'inline' script: | Write-Output abcde > abc.txt $letters = Get-Content .\abc.txt write-host "##vso[task.setvariable variable=json]$letters" write-host $(json) 

But in the console im not seeing the output abcde

what im doing wrong ?

im in purpose added the write-host "##vso[task.setvariable variable=json]$letters" so i will be able to use the variable json laster

1 Answer 1

1

The fact that you can not use a variable TFS on the same stage at which it created. Your code works fine, to test run:

steps: - task: PowerShell@2 displayName: 1 inputs: targetType: 'inline' script: | Write-Output abcde > abc.txt $letters = Get-Content .\abc.txt write-host "##vso[task.setvariable variable=json]$letters" write-host $(json) - task: PowerShell@2 displayName: 2 inputs: targetType: 'inline' script: | write-host $(json) 
Sign up to request clarification or add additional context in comments.

1 Comment

If the answer helped you, please mark it as correct.