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