This article is to document how to change the PowerShell version associated with a hook template using the CLI.

This operation is not allowed through GUI.

Procedure:

  1. Login into Delphix Engine CLI using "admin" credentials.

    ssh admin@<delphix_engine>
  2. Go to source and then to operationTemplate.

    delphix> source
    delphix source> operationTemplate
  3. Execute the ls command to see the existing hooks template and select one of the existing hook templates which you want to update.

    delphix source operationTemplate> ls
    Objects
    NAME                DESCRIPTION                  LASTUPDATED               OPERATION.TYPE                       
    Test_Template       Test_Template                2020-06-12T04:15:01.759Z  RunDefaultPowerShellOnSourceOperation
    
    delphix source operationTemplate> select Test_Template
    
    delphix source operationTemplate 'Test_Template'> ls
    Properties
        type: OperationTemplate
        name: Test_Template
        description: Test_Template
        lastUpdated: 2020-06-12T04:15:01.759Z
        operation:
            type: RunDefaultPowerShellOnSourceOperation
            name: Test_Template
            command: echo_command
        reference: OPERATION_TEMPLATE-1
  4. Run the update command and change the hook template type from RunDefaultPowerShellOnSourceOperation to RunPowerShellOnSourceOperation

    Users can also change the template type from RunPowerShellOnSourceOperation to RunDefaultPowerShellOnSourceOperation.
    delphix source operationTemplate 'Test_Template'> update
    delphix source operationTemplate 'Test_Template' update *> set operation.type=RunPowerShellOnSourceOperation
    delphix source operationTemplate 'Test_Template' update *> ls
    Properties
        type: OperationTemplate
        name: Test_Template
        description: Test_Template
        operation:
            type: RunPowerShellOnSourceOperation (*)
            name: Test_Template
            command: echo_command
  5. Run the commit command to perform the update on the hook template. Execute the ls command again to see the change in the hook template type.
delphix source operationTemplate 'Test_Template' update *> commit

delphix source operationTemplate 'Test_Template'> ls
Properties
    type: OperationTemplate
    name: Test_Template
    description: Test_Template
    lastUpdated: 2020-06-12T04:30:44.203Z
    operation:
        type: RunPowerShellOnSourceOperation
        name: Test_Template
        command: echo_command
    reference: OPERATION_TEMPLATE-1
  1. Template type can only be changed from "RunDefaultPowerShellOnSourceOperation" to "RunPowerShellOnSourceOperation" or vice versa. You can not change the type to other available types. If you try to do that, you will get this error: "Error: The type of this operation (RUN_POWERSHELL_ON_SOURCE_OPERATION) cannot be modified after creation.".
  2. Template type "RunPowerShellOnSourceOperation" denotes "PowerShell version 2" and "RunDefaultPowerShellOnSourceOperation" denotes "Default PowerShell version". Here, default version is the version of PowerShell installed on the target host.