def hello(name) {
    println("Hello $name")
}

In the console or the shell, you can invoke it as:

hello("nicolas")