Documentation Center

Setting Context Expressions

Use a PowerShell script to set a Context Expression on a Target Group.

Procedure

  1. Open a PowerShell script in the Run as an administrator mode.
  2. Go to modules\ContextExpressions.
  3. Run the following command:
    .\set-context-expression.ps1 -cmsUrl http://localhost -targetGroupId tcm:123-456-256 -contextExpression "browser.vendor == 'Google'"
    where:
    ParameterDescription
    -cmsUrlThe web address of the Content Manager Explorer.
    -targetGroupIdThe identifier of the Target Group on which a Context Expression will be set. It can be either TCM URI or WebDAV URL.
    -contextExpressionThe boolean JEXL Context Expression.
    (optional) -cmsUserNameThe username used for the authentication.
    (optional) -cmsUserPasswordThe password for the provided username.
    (optional) -cmsAuthThe authentication type; possible values are: Windows (default), and Basic.

    You can use the Basic authentication type, in case your Content Manager Server requires credentials other than Windows credentials.