When the Software Delivery Item Procedure or Job Option for Enabling User Interaction is selected it will only run scripts in a 32-bit mode which may cause the script to have an unexpected outcome depending on what it attempts to access or accomplish.
This document describes how you can use DMS scripting, to launch a script interpreter in 64-bit mode, to achieve the desired results.
Client Automation - All versions.
In this example we see how to call the PS1 file (powershell script) from a DMS script that sets 64-bit mode...
------------------------------
setmode64(TRUE)
dim sCmd as String
dim retcode as integer
sCmd = "powershell.exe -ExecutionPolicy ByPass -NoLogo -NonInteractive -WindowStyle Hidden -File your_script_name.ps1"
retcode=Execute(sCmd,True,0)
SetStatus(retcode)
Exit
------------------------------