For instance you can set a variable like this:
Examples:
##vsotask.setvariable variable=testvar;]testvalue ##vso[task.setvariable variable=testvar;issecret=true;]testvalue
in powershell:
Write-Host "##vso[task.setvariable variable=testvar;]testvalue"
Here’s the complete list:
https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md
Happy scripting!