PowerShell Logo Small

about_Parallel



This is the built-in help made by Microsoft for the document 'about_Parallel', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-24.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

Search powershellhelp.space

TOPIC
about_Parallel

SHORT DESCRIPTION
Describes the Parallel keyword, which runs the
activities in a workflow in parallel.

LONG DESCRIPTION
The Parallel keyword runs workflow activities in parallel.
This keyword is valid only in Windows PowerShell Workflow.

SYNTAX

workflow <Verb-Noun>
{
Parallel
{
[<Activity>]
[<Activity>]
...
}
}


DETAILED DESCRIPTION

The commands in a Parallel script block can run concurrently.
The order in which they run is not determined.

For example, the following workflow includes a Parallel script
block that runs activities that get processes and services on
the computer. Because the Get-Process and Get-Service commands
are independent of each other, they can run concurrently and in
any order.

workflow Test-Workflow
{
Parallel
{
Get-Process
Get-Service
}
}

Running commands in parallel is very efficient and reduces
the time it takes to complete a workflow significantly.

To run selected commands in a Parallel script block in
sequential order, use the Sequence keyword. For more
information, see about_Sequence.

To run a Parallel script block on items in a collection,
use the ForEach or ForEach -Parallel keywords.
"Writing a Script Workflow" (http://go.microsoft.com/fwlink/?LinkID=262872)
about_ForEach
about_ForEach-Parallel
about_Language_Keywords
about_Sequence
about_Workflows