I need to access Environment variables in Windows while running the
cookbooks. I have had 2 issues with this:
When I run with powershell and access them using $Env:HOME ( for
example) and run “chef client” manually on the box , it seems to pick it up
but when I run it from my CI , it doesn’t seem to work since the path seems
to change. I have been trying to echo this variable on the console but
haven’t been successful. How do we do this ?
If I am not using the powershell cookbook and I use the “remote_file” or
"remote_directory" resource to copy folders ( This works fine when I
hardcode the paths) , in that case, how do I access the PATH or the HOME
variable ( or basically any other Environment variable ) in my cookbooks?
Can you shed some light on this ?