Run a PowerShell Command
To run a PowerShell command from a process, do the procedure in this topic.
Prerequisites
Good to Know
- In most text fields, you can use process data variables as an alternative to literal data values.
- To enter the command from a file on the server, the file must have a .bat or .txt file extension.
- To run a PowerShell command on SharePoint, use the SharePoint PowerShell Command activity.
- You can configure whether this activity waits for other activities before it runs.
For more information, refer to How Do I Configure an Activity to Wait for Other Incoming Activities?
How to Start
- Open Process Builder.
For information about how to open this screen, refer to Process Builder.
- Do one of these:
- Click PowerShell Command .
Procedure
- 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.
- Select Input Text.
- In the Command field, enter your PowerShell command code.
- To enter the command from a file on the server, do this procedure.
- Select Read From File.
- Complete these fields
as necessary
Field Name Value File Path (AgilePoint Server File Path)
- Description:
- Specifies the location of the file that contains the PowerShell command.
- To Open this Field:
- Select Read From File.
- Allowed 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 Variables:
- Yes
- Example:
-
- c:\My Documents\sample1.doc
- ${HomeDirectory}\sample2.doc
- http://demo3:8000/DocumentLib1/sample3.doc
- To enter the command manually, do this procedure.
- In the Return Value field, enter the process data variable where you want to store the return value returned from your PowerShell command.