O'Reilly logo

Microsoft Windows PowerShell 3.0 First Look by Adam Driscoll

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Limitations of PowerShell workflows

There are many limitations of PowerShell workflows that are not set on regular scripts. The reason for much of it is to ensure that PowerShell follows the fundamental principles of Windows Workflow. It is required to lose some functionality to gain a whole lot more.

Variable scope

The first rule we need to examine is the workflow variable scope. This is done using the following commands. As already stated, activities are treated as independent units. So the PowerShell state, including variables, is not shared among the activities:

PS C:\> Workflow Start-Workflow { $process = Start-Process -FilePath Cmd -PassThru Get-Process -InputObject $process } PS C:\> Start-Workflow Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required