WorkFlow sessions (Advanced)

Windows PowerShell 3.0 has the capability to maintain workflows and execute them in the environment. It is built on Windows Workflow Foundation, which is written in XAML.

Getting ready

WorkFlow is an enhanced version of a function where you can create an execution sequence by using various command statements. It maintains a reliable session throughout the execution, which serves the reboot and disconnection of network problems in between the execution.

How to do it...

  1. There are two ways to execute a workflow in the console:
    • Using Invoke-AsWorkFlow
    • Using New-PSWorkflowSession

    Note

    You can create a workflow using the Workflow keyword.

    For example:

    Workflow <WorkFlowName>
    {
      # param block
      # logic block
    }
  2. The following command statement ...

Get Instant Windows PowerShell Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.