pipeline { agent any stages { stage('Test') { steps { script { // <--- Added script block if (isUnix()) { echo "Unix" } else { echo "Windows" } } } } } }