title: Azure DevOps - Pass Powershell list variable to yml template array
body: <p>I want to generate a list in a Powershell task as an output variable and use it in a yml template as a list to perform a loop for a task.</p>
  
  <pre><code>#Main
  - task: PowerShell@2
    condition: succeeded()
    displayName: "Create a list"
    inputs:
      targetType: 'inline'
      script: |
  
        $myList = New-Object System.Collections.ArrayList
  
        $myList.Add("wow")
  
        Write-Output ("##vso[task.setvariable variable=MyList;]$myList")
  
  - template: myRandomListTaskTemplate.yml
    parameters:
        MyList: $(MyList)
  
  
  #Template
  parameters:
    MyList: []
  
  steps:
  
  - ${{ each myList in parameters.MyList }}:
      - task: PowerShell@2
        condition: succeeded()
        displayName: "WOW a list"
        inputs:
            targetType: 'inline'
            script: |
              Write-Host("A list string: ${{ myList }}")
  </code></pre>
  
  <p>I am getting the error </p>
  
  <pre><code>Expected a sequence or mapping. Actual value '$(MyList)'
  </code></pre>
  
  <p>Note: The Powershell Task in the Template is just an example, it can be other Tasks that are not Powershell related (example: DotNetCoreCLI@2)</p>