NERD MEMO PER ME🙂

Richard Siddaway's Blog

I said in the first post in this series that you could force a workflow to perform tasks in parallel or in sequence. Starting with parallel you can force parallel execution by using the parallel keyword:

workflow thursday1 {
parallel {
1..26 | foreach {$psitem}
65..90 | foreach {[char][byte]$psitem}
97..122 | foreach {[char][byte]$psitem}

1..26 | foreach {$psitem}
65..90 | foreach {[char][byte]$psitem}
97..122 | foreach {[char][byte]$psitem}

1..26 | foreach {$psitem}
65..90 | foreach {[char][byte]$psitem}
97..122 | foreach {[char][byte]$psitem}
}
}

thursday1

In this workflow I’m printing out the numbers 1-12, the characters A-Z and a-z then repeating those actions another 2 times. The repetition is to force the parallelism to be visible. If you just run one repetition everything runs so fast that you don’t see any evidence of parallel activity. if you look carefully at the output you will see evidence of parallelism. For instance the test I ran showed…

View original post 272 altre parole