Abstract
In this chapter, we will discuss creating and executing workflows in PowerShell. Workflow Foundation is a .NET framework for defining complex processes that can span a long period of time, can be stopped and restarted where they left off, support the parallel execution of tasks, and can be packaged into reusable components. Until PowerShell 3.0, workflows could only be created in Visual Studio using C# or VB.Net. PowerShell 3.0 added support for the creation and execution of workflows. Since workflows can be executed either locally or on remote machines, we’ll start by discussing PowerShell remote execution. Workflows are suspended and restarted using PowerShell job cmdlets, which were covered in the previous chapter. Here, we’ll see how they apply to workflows. We will discuss using the commands parallel, foreach –parallel, sequence, and inlinescript to control workflow execution. Then, we will delve into using the cmdlets Checkpoint-Workflow, Suspend-Workflow, and Resume-Job to pause and resume workflow execution. Workflows can work on a single object at a time or on a collection. For example, John Doe applies for insurance coverage, and a series of steps occur until he is either insured or rejected. This pattern of usage is common to ASP.Net applications. A workflow could be used to load a series of external files into staging tables, validate the data, and, finally, load them into a data warehouse. We will cover two data-centric use cases for workflows. One is a typical data-warehouse load scenario. The other uses a workflow to speed up the extraction of data from flat files using parallel processing, similar to Hadoop.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Bryan Cafferky
About this chapter
Cite this chapter
Cafferky, B. (2015). PowerShell Workflows. In: Pro PowerShell for Database Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0541-9_13
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0541-9_13
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0542-6
Online ISBN: 978-1-4842-0541-9
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books