Tutorial by Examples

workflow DoSomeWork { Get-Process -Name notepad | Stop-Process } This is a basic example of a PowerShell Workflow definition.
Just like PowerShell functions, workflows can accept input parameter. Input parameters can optionally be bound to a specific data type, such as a string, integer, etc. Use the standard param keyword to define a block of input parameters, directly after the workflow declaration. workflow DoSomeWork ...
PowerShell Workflows are inherently equipped with the ability to run as a background job. To call a workflow as a PowerShell background job, use the -AsJob parameter when invoking the workflow. workflow DoSomeWork { Get-Process -ComputerName server01 Get-Process -ComputerName server02 Get-...
workflow DoSomeWork { parallel { Get-Process -ComputerName server01 Get-Process -ComputerName server02 Get-Process -ComputerName server03 } } One of the unique features of PowerShell Workflow is the ability to define a block of activities as parallel. To use this feature, us...

Page 1 of 1