Powershell – Jenkins parameters with powershell

jenkinspowershell

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.

Best Solution

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}