bug fix for #3077, environment settings for script

This fix would enable environment to be specified for task using script module.