Simplify WF Workflows With PowerShell scripting
Simplify WF Workflows With PowerShell scripting
  • Call and execute PowerShell scripts directly from within Windows Workflow Foundation workflows.
  • Execute remote scripts when used with PowerShell SSH Server.
Download Free Trial

The PowerShell Workflow Activity allows you to execute PowerShell scripts from within Windows Workflow Foundation workflows. Each instance of the activity on a workflow can define a different PowerShell script to execute.

Using the PowerShell Workflow Activity

To use PowerShell Workflow Activity, follow these simple steps:

  1. Open your workflow in the Visual Studio designer
  2. Drag the PowerShellSendActivity from the Toolbox into your workflow
  3. Configure the activity properties with the following:
    • A name that identifies this activity.
    • The PowerShell script to run when the activity is executed. You can just write your script directly in the activity properties, or dot-source an external script file with your commands.

Executing Scripts on Remote Machines

PowerShell Workflow Activity also allows you to execute scripts on remote machines using the PowerShell V2 Remoting protocol or the PowerShell Server protocol.

To use PowerShell Remoting, you need to set the following options in the task properties:

  • Host: The name or IP address of the remote computer.
  • Protocol: set to prRemoting;.
  • User and Password: Optional. If not specified, the connection will be attempted using the user the SSIS workflow is running under.

To use PowerShell Server, you need to have PowerShell Server installed and running in the remote machine, and configure the following properties:

  • Host: The name or IP address of the remote computer.
  • Protocol: set to prSSH.
  • SSHAuthMode: Set to amPassword for username/password authentication or to amPublicKey for public key authentication. For the latter, this option needs to have been enabled in the remote PowerShell Server, and the task needs to have access to a certificate the server will accept.
  • User: The username to be used for authentication.
  • Password: Optional. The host key/certificate used to authenticate the server.
  • SSHCert: The certificate to use for public key authentication.