windows - reading environmental variables in powershell or cmd yield different results -
i have been puzzling on issue environmental variables in windows 7.
we have jenkins server cannot find ssh keys in %home% environmental variable wants access path:
/c/users/jenkins however if use
echo %home% in normal command prompt window jenkins user result
c:\users\jenkins however if use env command in windows powershell get
/c/user/jenkins in normal gui accessible system properties - advanced tag -> environmental following
c:\users\jenkins i have tried setting them issue persists. in far jenkins gets same output powershell.
my questions how set them back? (not cmd , windows system think set wrong) how on earth accessing same environmental variable give me different outputs ? know way in can occur ? know stored can manually edit stored ?
thanks in advance.
as mentioned in comment @luis, env command not part of powershell. provided other set of utilities have installed , intended emulate linux env command.
to refer environment variable in powershell, use $env:<variable-name> syntax or environment provider - get-content env:\<variable-name>.
to set environment variable, can use $env:<variable-name> = "<variable-value>"
for more info, try running help about_environment_variables in powershell.
Comments
Post a Comment