Add provision for passing environment via sudo. Add docs. Should resolve #13537