Skip to main content
Delphix

Powershell Execution Formats When Using Path Names Containing White Space (KBA1825)

 

 

KBA

KBA#1825

Issue

With feature flag MSSQLHOOKS or on newer 5.2 and higher engines that do not require a feature flag, you can execute Powershell hooks to perform various pre and post tasks as part of the dataset workflow. There are times when hook scripts are located in Windows directories containing white space, such as C:\Program Files\Delphix\display.ps1. During hook execution, a user exception or fault is not thrown but the hook work is not done.  When executed via a job like a VDB refresh, the job completes successfully but without the additional work expected from the hook execution.

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases
6.0 6.0.0.0, 6.0.1.0, 6.0.1.1

5.3

5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1, 5.3.9.0

5.2

5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1

5.1

5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0

5.0

5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4

4.3

4.3.1.0, 4.3.2.0, 4.3.2.1, 4.3.3.0, 4.3.4.0, 4.3.4.1, 4.3.5.0

4.2

4.2.0.0, 4.2.0.3, 4.2.1.0, 4.2.1.1, 4.2.2.0, 4.2.2.1, 4.2.3.0, 4.2.4.0 , 4.2.5.0, 4.2.5.1

4.1

4.1.0.0, 4.1.2.0, 4.1.3.0, 4.1.3.1, 4.1.3.2, 4.1.4.0, 4.1.5.0, 4.1.6.0

 

Troubleshooting

This one is difficult to troubleshoot due to a lack of errors thrown.  In the case of a pre-refresh or post-refresh hook, the VDB has provisioned and the job completed. Some programmers do code the ability to capture information in a log configured locally on the Windows host. 

Review and validate the path and filename configured for the hook (on the live engine) to determine if any white space is included and if the path and/or file name is not enclosed in single or double quotes.

Resolution

For powershell command line execution syntax, format the command with quotes and ampersand.

For example, this execution will likely fail:

C:\Program Files\Delphix\display.ps1 POST-REFRESH

It can execute with one of the following formats:

& "C:\Program Files\Delphix\display.ps" POST-REFRESH

or

& 'C:\Program Files\Delphix\display.ps' POST-REFRESH

Additional Information

N/A