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.
:SET &LOGIN# = GET_LOGIN("LOGIN_TEST","*","win",PASSWORD)
: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"
@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