Run a PowerShell Command

To run a PowerShell command from a process, do the procedure in this topic.

Figure: Configuration for calling PowerShell Command screen

Configuration for calling PowerShell Command screen

Prerequisites

Good to Know

How to Start

  1. On the App Explorer screen, do one of these:
  2. Do one of these:
    • Add an activity:
      1. In Process Builder, in the Activity Library, open the Utilities tab.

        Open Utilities tab
      2. On the Utilities tab, drag the PowerShell Command activity onto your process.

        Drag PowerShell Command activity
    • Change an activity:
      1. In your process, double-click your activity.
  3. Click PowerShell Command PowerShell Command icon.

Procedure

  1. To run a PowerShell command, on the Configuration for calling PowerShell Command screen,do one of these.
    • To enter the command manually, do this procedure.
      1. Select Input Text.
      2. In the Command field, enter your PowerShell command code.
    • To enter the command from a file on the server, do this procedure.
      1. Select Read From File.
      2. Complete these fields as necessary
        Field NameValue

        File Path (AgilePoint Server File Path)

        Function:
        Specifies the location of the file that contains the PowerShell command.
        To Open this Field:
        Select Read From File.
        Accepted Values:
        An absolute path and file name on the AgilePoint Server or SharePoint Server.

        The file name must have the extension .bat or .txt.

        Default Value:
        None
        Accepts Process Data Variables:
        Yes
        Example:
        • c:\My Documents\sample1.doc
        • ${HomeDirectory}\sample2.doc
        • http://demo3:8000/DocumentLib1/sample3.doc
  2. In the Return Value field, enter the process data variable where you want to store the return value returned from your PowerShell command.