I just started using the new workflow construct in posh, and I’m wondering if there’s a way to specify a ‘throttle limit’ ( or something similar) parameter in the parallel blocks so that only x-number of simultaneous instructions get executed at once. For example, i would like to limit the following file copies to 32 nodes at a time:
workflow Distribute-Directory
{
[CmdletBinding()]Â Â
Param
(
$dir_source = ‘C:\TEMP_packages\Intel-825xx-Gigabit-Ethernet-Controller’,
$dir_dest = ‘c$\temp’,
[string]$node
)
Foreach -parallel ($node_dest in $node) {
cmd /c robocopy $dir_source $("\\"+$node_dest+"\"+$dir_dest+"\"+(get-item $dir_source).Name) /E
}
}
Many thanks!