title: How To Get The Value Of An Environment Variable In Elixir On Windows?
body: <p>Windows 10</p>
  
  <p>Elixir 1.3.1</p>
  
  <p>Per the advice in <a href="http://blog.plataformatec.com.br/2016/05/how-to-config-environment-variables-with-elixir-and-exrm/" rel="nofollow">this article</a>, I've tried to modify my config files to use the "${ENV_VAR}" syntax. But then when I try to compile the code Elixir complains about the values of the configuration settings.  So I tried the syntax directly in iex and it doesn't seem to work.</p>
  
  <pre><code>iex(1)&gt; "${PATH}"
  "${PATH}"
  iex(2)&gt; System.get_env("PATH")
  "C:\\Program Files\\erl8.0\\erts-8.0\\bin;C: . . ." (rest omitted for brevity's sake)
  </code></pre>
  
  <p>I'd really like to use the "${ENV_VAR}" notation because it'd be nice to not have to hand-edit the sys.config file.  Am I doing something wrong or is this just a Windows specific issue?</p>
  
  <p>Here's part of my config file (even though, as I say, it seems I can reproduce the behavior in iex):</p>
  
  <p>config :riismi, ecto_repos: [Riismi.Repo]</p>
  
  <pre><code>config :riismi, Riismi.Mailer,
      adapter: Bamboo.SMTPAdapter,
      server: "smtp.gmail.com",
      port: 465,
      username: "${RMI_MAIL_SERVERUSER}",
      password: "${RMI_MAIL_SERVERPWD}",
      tls: :if_available, # can be `:always` or `:never` or `:if_available`
      ssl: true, # can be `true`
      retries: 3
  </code></pre>
  
  <p>As I say, I realize this is likely to be a Windows issue--just wanted to insure that I'm not missing something otherwise.</p>