&UC_JOBMD -- decrypted password as parameter to powershell

Discussion created by Pratima_Mokkala_845 on Oct 17, 2014
Latest reply on Oct 22, 2014 by Pratima_Mokkala_845

I need to execute a powershell script by passing a password that was extracted from a login object.But each time it failed recognize the encrypted password.When I hardcode the password it works fine.
&UC_JOBMD  is equivalent to "C:\Automic\Agents\Windows\bin\UCXJWX6M.EXE "
So &UC_JOBMD is not empty.

Code :
! extracting password
:PRINT This is pass &PW#  --- encrypted password

  &UC_JOBMD CMD="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File D:\pecom\appl\uc4\pshell\ps_call_remote_program.ps1 -server_user "&LOG_IN#" -server_password "%SecurePassword%" -server_name "&SERVER#" -script_name %fp_remote_script_name% -script_param1 %remote_script_parm1% -script_param2 %remote_script_parm2%"

I also tried below option posted in this forum [it didn't work]:

This is how I get the unencrypted password into a powershell variable;

:JCL_SUBSTITUTE "$", "&"  
$ &UC_JOBMD CMD='echo &PASS#'


$SecurePassword = (&UC_JOBMD CMD="echo &PASS#")

Please guide on where am I going wrong.

Thank You,