IF statement in Jenkins windows boolean parameter

11,806
IF "%WIN7%"=="true" (
...
)

Quotes are also part of the compared string.And are required when there is a space within the compared values.

Share:
11,806
arsenik
Author by

arsenik

Web developer

Updated on June 17, 2022

Comments

  • arsenik
    arsenik almost 2 years

    On Jenkins installed on windows 7, I choose :

    This build is parameterized

    Add a Boolean parameter named WIN7

    Then in Windows batch command I want to do something if WIN7 parameter is selected.

    How boolean are converted? I tried the following but no success

    IF %WIN7%=="true" (
    
    )
    

    Also :

    echo %WIN7% 
    

    is printing true