You can run a workflow to generate an action from a PowerShell script that you provide. You can optionally generate a sample workflow that can run the generated action.

About this task

You can customize the script of the action that you generate by using placeholders. For each placeholder, the workflow creates a corresponding action parameter of type string in the generated action. When you run the action, you can provide an actual value as the action parameter to replace the placeholder.

Prerequisites

  • Verify that you are logged in to the Orchestrator client as an administrator.

  • Verify that you have a connection to a PowerShell host from the Inventory view.

Procedure

  1. Click the Workflows view in the Orchestrator client.
  2. In the workflows hierarchical list, expand Library > PowerShell > Generate and navigate to the Generate an action from a PowerShell script workflow.
  3. Right-click the Generate an action from a PowerShell script workflow and select Start workflow.
  4. In the Script text box, type or paste the PowerShell script from which to generate the action.
    Note:

    You can use {#ParamName#} as a placeholder for user input. If the placeholder is of type string, you must use double quotes to pass the value of the placeholder to the action.

    The following script is an example of how to link the generated action parameter to a script parameter.

    param($name={#ParamName#})
    echo $name;
  5. In the Name text box, type a name for the action that you want to generate.
  6. Select an existing module in which to generate the action.
  7. Select whether to generate a workflow.

    Option

    Description

    Yes

    Generates a sample workflow that can run the generated action. You must select a folder in which to generate the workflow.

    Note:

    The name of the generated workflow consists of the predefined string Invoke Script and the name of the generated action.

    No

    A sample workflow is not generated.

  8. Click Submit to run the workflow.

What to do next

You can integrate the generated action in custom workflows.