17

how to pass the jenkins string parameters to power shell script param value?

I have to pass the source path url to the powershell script param value. Given the Source path as string parameter in jenkins. I want to know how to pass the jenkins parameter value into powershell script param value.

2

1 Answer 1

29

Every parameter in a job is available to PowerShell as an environment variable, so if your parameter is named i.e. SourcePath you can write it in PowerShell as ${env:SourcePath}

Sign up to request clarification or add additional context in comments.

1 Comment

$env:SourcePath also can be used

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.