Katyayan Vedant Katyayan Vedant - 4 months ago 12
Powershell Question

JENKINS_HOME string getting appended after resolving to actual in powershell

I am using

%JENKINS_HOME%
inside my powershell script, but in jenkins it is getting resolved to the actual path with
%JENKINS_HOME%
getting appended.

for example: I am using

cd "%JENKINS_HOME%"


and what in actual is happening is

cd C:\Users\Vedant\.jenkins\jobs\my_job\%JENKINS_HOME%

Answer

Try this instead:

$env:JENKINS_HOME