With putty, you have an interactive shell, and many files are sourced (.bash_profile, .bashrc, .profile...).
With a non interactive shell (this is the case with CreateCommand()), a subset or none of those files are sourced, it depends on the registered shell with the user account, and the linux system (archlinux/debian).
What you can do, the most secure/sure way, is to edit your sshd_config file, add "PermitUserEnvironment yes", restart sshd, then create a file ~/.ssh/environment and set the environment variable you want.
If you can't do it, you can still prefix each command :
"pwd; echo $PATH" => "pwd; PATH=$PATH:/something echo $PATH"
With a non interactive shell (this is the case with CreateCommand()), a subset or none of those files are sourced, it depends on the registered shell with the user account, and the linux system (archlinux/debian).
What you can do, the most secure/sure way, is to edit your sshd_config file, add "PermitUserEnvironment yes", restart sshd, then create a file ~/.ssh/environment and set the environment variable you want.
If you can't do it, you can still prefix each command :
"pwd; echo $PATH" => "pwd; PATH=$PATH:/something echo $PATH"