It’s been surprisingly difficult to find a simple straightforward answer to this question. I know how to SET environment variables, but if I have a Windows environment variable already defined when I start Jenkins, can I reference that in the script console?
by script console do you mean $JENKINS_URL/script? You should be able to use straight up groovy, so
If by script console you mean jenkinsfile/pipeline. By default system env variables are not exposed, you generally want to set them up in the agent configuration screen.
OK - thank you for the reply. Turns out
System.getenv('FOO') is all I needed, thanks!