Run a PowerShell Command on SharePoint

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

Configuration for calling SharePoint PowerShell Command Screen



Prerequisites

  • AgilePoint PrivateCloud (on-premises) environment.

Good to Know

How to Start

  1. On the Organizer, do one of these:
  2. Do one of these:
    • Add an activity:
      1. In the Process Builder, go to the Activity Library, and open the SharePoint tab.
      2. On the SharePoint tab, drag the SharePoint PowerShell Command activity onto your process.
    • Change an activity:
      1. In your process, double-click your activity.
  3. Click SharePoint PowerShell Command .

Procedure

  1. To run a PowerShell Command, on the Configuration for calling SharePoint 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 Name Value

        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.