PowerShell – Workflows

Reference material:

Import-Module PSWorkflow

workflow Test-WorkflowInline{
        $object = New-Object -TypeName PSObject
        $object | Add-Member -MemberType NoteProperty `
                -Name ExampleProperty `
                -Value 'Hello!'
        $object | Get-Member
    # The $object variable no longer exists at this point as it has left the InlineScript block.
    #The below line fails if uncommented.
    # $object |Get-Member

workflow Test-WorkflowParallel{
    "This line will always run first!"
    parallel {
        "Command One."
        "Command Two."

            "Command Alpha."
            "Command Beta."

# Possible output from Test-WorkflowParallel:
# This line will always run first!
# Command One.
# Command Alpha.
# Command Beta.
# Command Two.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s