title: Define a list variable in azure devops pipeline on runtime
body: <p>I have an azure pipeline YAML file and I can't figure out how to declare a list variable in a script and use it on the next step.</p>
  <p>What I would like is something like that:</p>
  <pre><code>- script: echo &quot;##vso[task.setvariable variable=packages]@('a','b')&quot;
    
  - template: publish-template.yml
    parameters:
      packages: packages
  </code></pre>
  <p>or</p>
  <pre><code>- script: echo &quot;##vso[task.setvariable variable=packages]@('a','b')&quot;
    
  - ${{ each package in parameters.packages }}:
    - script: echo ${{ package }}
  </code></pre>
  <p>But I can't find out how it's possible.</p>
  <p>Thanks :)</p>