in reply to Environment Variable Setting

See Get default login environment and also Shell, of which Shell::GetEnv and Shell::EnvImporter seem as if they do the same as that node (and its discussion).