Not able to pass password to powershell script

Discussion created by rajkumar.pandiaraja on Sep 12, 2018
Latest reply on Sep 18, 2018 by MatthiasSchelp

Dear Experts,


I am creating a windows job to execute the powershell script in AWA 12. I am facing issues when passing the password to powershell as powershell is not able to recognize the password. Please share your inputs to solve this issue.


Below are the lines written in my script.

:print This is : &LOGIN#
: SET &SecurePassword# = (&UC_JOBMD CMD="echo &LOGIN#")
:print This is : &SecurePassword#
:SET &URL# = "somepath"


powershell -command D:\test\pstest\testing.ps1 -username "<ara_clnt>/<username>/<department>" -password &SecurePassword# -artifacturl &URL# -profile "someprofile"


@set retcode=%errorlevel%
@if NOT %ERRORLEVEL% == 0 goto :retcode

The powershell script is calling an ARA object.

When executing the job i am getting below error. Please check and share your views.


C:\>powershell -command D:\test\pstest\testing.ps1 -username "<ara_clnt>/<username>/<department>"
-password N -artifacturl &URL# -profile "someprofile" ConvertTo-SecureString : The parameter value "N" is not a valid encrypted  string.

I have referred lot of pages in community for example  below.
&UC_JOBMD -- decrypted password as parameter to powershell

Rajkumar Pandiaraja