Workspace Environment Management

Scripted Task Settings

Lists all scripted tasks available on the Scripted Tasks page. Scripted tasks run at a configuration set level. Here, you configure which scripted tasks to enable for the current configuration set. To edit your scripted tasks, go to Scripted Tasks.

Configure a scripted task

  1. On the Scripted Task Settings page, locate the scripted task, select the ellipsis, and then select Configure.

  2. In the Configure scripted task wizard, configure the following settings and then click Save.

In General:

  • Enable this task. Choose whether to enable (Yes) or disable (No) the task for the current configuration set. If disabled, the agent does not process the task.
  • Verify signature. Choose whether to verify the signature before running the task. Signature verification is mandatory when the scripted task is granted full access.
  • Task timeout. Choose whether to set a timeout (in minutes) for the task. When the timeout occurs, the task is forced to end. Supported values: 1–60. We recommend setting a timeout for the task. Otherwise, the task might be left running, preventing other tasks from running.

  • Filter. Choose whether to contextualize the task by selecting a filter. With a filter selected, this task runs only when all conditions in the filter are met. When selecting a filter, consider the following:

    • If the filter contains conditions that do not apply to scripted tasks, the agent skips those conditions when evaluating the filter before running the task. For a complete list of conditions that do not apply to scripted tasks, see Conditions not applicable to machine settings.

In Triggers:

  • Configure triggers for the task. You can do the following:

    • Select triggers that you want to associate with the task. When activated, those triggers start the task in the user environment.

    • Choose whether to show only triggers that apply to this task.

    • Create a new trigger. See Create a trigger.

    Note:

    To edit existing triggers, go to Triggers.

In Parameters:

  • Pass parameters to the scripted task. Choose whether to pass parameters to the scripted task. When enabled, lets you provide inputs as parameter variables in the scripted task at runtime. The benefit is that you can control how the scripted task behaves without changing the underlying code. The following parameter types are available:

    • Integer. Example: 123.
    • String. Example: hello world.
    • Boolean. True or False.
    • Character. Example: c.
    • Switch. True or False.
    • Double. Example: 1.023.
    • Date and time. Example: YYYY-MM-DD HH:mm:ss.
    • File path. Enter a path that you want to pass to the System.IO.FileInfo class. Environment variables are supported. The path must not include the following characters: * ? < >.

    Note:

    • You can configure up to 20 parameters.
    • The name field is optional except for parameters of the “switch” type.
    • PowerShell supports partial parameter names. When using a partial parameter name, make sure that the name is unique — disambiguate it from existing parameter names. Example: The following parameter names are the same for PowerShell: -t, -ti, and -title. In this case, supply enough letters of the parameter name to distinguish it from the other parameters.

In Output:

  • Output files. Choose whether you want to collect files that the task outputs. If selected, includes output file content in reports generated for the task. You can then view the output file content in the reports without the need to access the output files in the user environment.

  • Output highlights. Choose whether you want to highlight certain content in the output file content and the console output.

    • Highlight keywords. Specify keywords that you want the report to highlight. You can type multiple keywords, separated by commas. After typing a keyword, press Enter to continue. If specified, report contents that match your keywords will be highlighted in the Output file content and Console output sections in the generated reports.

    • Highlight regular expression matches. Enter a regular expression that describes the content you want to highlight. The regular expression must conform to the .NET regular expression library syntax, which is PCRE compatible. For more information, see the Microsoft documentation: https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference.

      • Regular expression. Enter a regular expression that describes the content you want to highlight.
      • Ignore case. Choose whether content must exactly match the case.
      • Use multiline matching. Choose whether to use multiline matching, where \^ and $ match the beginning and end of each line, instead of the beginning and end of the entire output content.
      • Capture only named groups. Choose whether to capture only named groups. Captured groups are defined by using parentheses in the regular expression pattern. Named groups are explicitly assigned a name or a number by the (?<name> subexpression) syntax.
      • Number of lines to include as context clues. Specify the number of lines before and after the match you want to include in the highlight as context clues. Supported values: 1–10.
      • Include only regular expression matches in reports. Controls whether to include the entire output content in reports or only content that matches the regular expression. Enabling this option reduces the amount of data transmitted to Citrix Cloud. With the option enabled, the Highlight keywords feature has no content to show regardless of the specified keywords.
  • Advanced options.

    • Collect output even if runtime errors occur. Controls whether to collect output file content and console output even if errors occur while running the task.

View reports for a scripted task

On the Scripted Task Settings page, locate the scripted task, select the ellipsis, and then select View reports. As a result, you are taken to the Monitoring > Reports page, where you see the reports (if any) related to the task. Click the ellipsis to view more detailed information. For details, see Reports.

Scripted Task Settings