mkreddy17
Mega Contributor

Chad,


Did you get solution for it? I am having issues in passing variables to powershell script, I am passing like $env:SNC_<variable_name> but script is failing but if i hard code value there its success.



Thanks,


Kartheek


Kartheek,



I have not managed a solution for using the PowerShell script variables field yet. Are you using the Script file field on the Run PowerShell activity to pass your script or are you using the command window? I have done alot of PowerShell activities so maybe I could help get yours going.



Regards,


Chad


Chad,


I found solution for this, it looks like below.


In your workflow you should pass name as :


"name": "${your variable here if dynamic}"



and in powershell


$localVar = $env:SNC_name; // this is your workflow var



Thanks,


Kartheek


View solution in original post

Kartheek,



That did it! Thank you very much.



Regards,


Chad


Hello everyone,



I would like to execute a Powershell script over the Run Powershell workflow acticity.



But I don't really know who does it work. Could somebody explain me who I can define PowerShell script variables for the command field?