The delete command has the option of being interpolated, which is very handy.
The issue is that it appears only the slave's environment variables are consulted when interpolating variables. This was discovered by trial and error, as seems to be confirmed by looking at the code.
I would prefer to also consult the jenkins global environment, or the actual process environment.
My situation is that I have lots of linux nodes, and a few windows nodes. I don't mind specifying variables for the few windows nodes, but it's tedious to specify for all the other nodes as well (maybe a scripted way to do this, but still)...
This improvement would allow using the env inject plugin, or jenkins global environment, etc to define the cleanup command.