SharePoint PowerShell Command activity

An activity that specifies a PowerShell command to run from a process.


SharePoint PowerShell Command activity

Configure the SharePoint PowerShell Command activity

To configure the SharePoint PowerShell Command activity, do the procedure in this topic.

Examples

Prerequisites

Good to Know

How to Start

  1. On the Application Explorer screen, 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 SharePoint icon tab.
      2. On the SharePoint SharePoint icon tab, drag the SharePoint PowerShell Command SharePoint PowerShell Command icon activity onto your process.
    • Change an activity:
      1. In your process, double-click your activity.

Procedure

  1. Complete the fields on the General Configuration screen.

    For more information, refer to Configure General Options for a System Activity.

  2. Click SharePoint PowerShell Command SharePoint PowerShell Command icon.
  3. Configure Configuration for calling SharePoint PowerShell Command screen.

    For more information, refer to Run a PowerShell Command on SharePoint.

  4. (Optional) Click Advanced Advanced icon > E-mail Notifications E-mail Notifications icon.

    For more information, refer to Configure E-mail Notifications for Any Activity.

General Configuration

Specifies the basic settings for the And activity.

Figure: General Configuration screen

General Configuration screen

Fields

Field Name Definition

Display Name

Function:
Specifies the activity name that shows in your process.
Accepted Values:
One line of text that can have spaces.
Default Value:
None
Accepts Process Data Variables:
No
Example:
This is a common configuration field that is used in many examples. Refer to:
  • Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.

Description

Function:
Specifies an optional text description for your activity.
Accepted Values:
More than one line of text.
Default Value:
None
Accepts Process Data Variables:
No

Configuration for calling SharePoint PowerShell Command

Specifies the PowerShell command to run in your SharePoint environment.

Figure: Configuration for calling SharePoint PowerShell Command screen

Configuration for calling SharePoint PowerShell Command screen

Fields

Field Name Definition

Command Source

Function:
Specifies the source of the command.
Accepted Values:
  • Input Text - Lets you enter a command in text format in the Command field.
  • Read From File - Lets you upload a command from a file on your AgilePoint Server or SharePoint Server.
Default Value:
Input Text
Accepts Process Data Variables:
No

Command

Function:
Specifies a command or executable file to run. The command code must be in PowerShell format.
Accepted Values:
A valid PowerShell command or executable name.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:
Install-SPSolution -WebApplication "${/pd:AP/pd:processFields/pd:sitecollection}" 
     -GACDeployment -FullTrustBinDeployment -Identity Ascentn.SharePoint.SettingsList.wsp 
     -CompatibilityLevel All

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

Return Value (Get Console Output Value)

Function:
Stores output in specified process data variable.
Accepted Values:
A process data variable.
Default Value:
None
Accepts Process Data Variables:
Yes