Skip to content

Environment variables example not working #25708

Discussion options

You must be logged in to vote

Different shells have different syntax for accessing environment variables, and different OSes have different default shells.

Assuming an environment variable named FOO, the $FOO syntax works only on the bash shell.

If you’re running on windows, the default shell is powershell, and the syntax would be $env:FOO

Alternatively, if you want your workflow to support multiple OSes, and want to use environment variables in the commadn line without changes between OSes, then you should explicitly specify the shell as bash.

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants