Chapter 23. PowerShell workflows

 

This chapter covers

  • Defining a workflow and learning when to use it
  • Understanding workflow syntax
  • Running a workflow
  • Troubleshooting a workflow

Workflows are an important new feature that was introduced in PowerShell v3. They’re an incredibly rich, complex technology that we can’t possibly cover comprehensively in this chapter—they deserve their own book. But they are a type of tool you can create and make great use of, which is why we want to include this chapter as an introduction to them.

We view workflows as a hardcore programming topic, and that’s another reason we won’t try to give them full coverage in this chapter. Instead, we’re going to skim them lightly, showing you enough to create a basic workflow on your own, and we’ll continue to assume that you’re an administrator and not a professional developer. You have plenty of time to explore on your own, using this chapter as your starting point.

23.1. Workflow overview

Workflows are a type of PowerShell command, just as cmdlets and functions are types of commands. In fact, one of the easiest ways to understand workflows is to contrast them with their closest cousin: functions.

23.2. Workflow basics

23.3. General workflow design strategy

23.4. Example workflow scenario

23.5. Writing the workflow

23.6. Workflows vs. functions

23.7. Specific workflow techniques

23.8. Running a workflow

23.9. A practical example

23.10. Invoke-AsWorkflow

23.11. PSWorkflowSession

23.12. Troubleshooting a workflow

23.13. Summary