PowerShell Workflow reference script variables
<p>The following code works fine thanks to <a href="https://stackoverflow.com/questions/37881875/powershell-workflow-foreach-parallel-object/37882873#37882873">Thom</a>:</p>

<pre><code>Workflow Test-Fruit {
    foreach -parallel ($I in (0..1)) {
        # Create a custom hashtable for this specific object
        $WORKFLOW:Result = [Ordered]@{
            Name  = $I
            Taste = "Good $I"
            Price = "Cheap $I"
        }

        Parallel {
            Sequence {
                # Add a custom entry to the hashtable
                $WORKFLOW:Result += @{'Color' = "Green $I"}
            }
            Sequence {
                # Add a custom entry to the hashtable
                $WORKFLOW:Result += @{'Fruit' = "Kiwi $I"}
            }
        }

        # Generate a PSCustomObject to work with later on
        [PSCustomObject]$WORKFLOW:Result
    }
}
Test-Fruit
</code></pre>

<p>But when I try to add another variable in the parent scope, to be used later on in some of the <code>Sequence</code> blocks, this fails:</p>

<pre><code>Workflow Test-Fruit {
    foreach -parallel ($I in (0..1)) {
        # Create a custom hashtable for this specific object
        $WORKFLOW:Result = [Ordered]@{
            Name  = $I
            Taste = "Good $I"
            Price = "Cheap $I"
        }

        $WORKFLOW:Files = Get-ChildItem -Path c:\

        Parallel {
            Sequence {
                # Add a custom entry to the hashtable
                $WORKFLOW:Result += @{'Color' = "Green $I"}

                if ($I -eq 0) {
                    # Do smething with Files
                    $WORKFLOW:Files.Name | Select-Object -First 1
                }
            }
            Sequence {
                # Add a custom entry to the hashtable
                $WORKFLOW:Result += @{'Fruit' = "Kiwi $I"}

                if ($I -eq 1) {
                    # Do smething with Files
                    $WORKFLOW:Files.Name | Select-Object -Last 1
                }
            }
        }

        # Generate a PSCustomObject to work with later on
        [PSCustomObject]$WORKFLOW:Result
    }
}
Test-Fruit
</code></pre>

<p>With the following error:</p>

<blockquote>
  <p>Item has already been added. Key in dictionary: 'Color'  Key being
  added: 'Color' Item has already been added. Key in dictionary: 'Fruit'
  Key being added: 'Fruit'</p>
</blockquote>

<p>How can I define another script variable so to speak and then use it in the <code>Sequence</code> blocks?</p>