title: .Renviron variables not found when Rscript run from powershell?
body: <p>I have an R script that runs perfectly when run from Rstudio. It uses an <code>.Renviron</code> file to provide environment variables which are visible in <code>Sys.getenv()</code> (so I know it works).</p>
  <p>However, when I run the exact same script via powershell, the R script mysteriously doesn't find those environment variables (I confirmed this by <code>print(Sys.getenv())</code> - the environment variables provided through <code>.Renviron</code> are nowhere to be seen.</p>
  <h3>Question</h3>
  <p>Why aren't the <code>.Renviron</code> variables being found when the R script is run from powershell (as opposed to when the script is run in RStudiom, where everything works)</p>
  <h3>What I've tried</h3>
  <p>The <code>.Renviron</code> file is currently saved in <code>&quot;C:/Users/Administrator/Documents/.Renviron&quot;</code></p>
  <p>Inspecting <code>normalizePath(Sys.getenv('R_HOME'))</code> returns <code>&quot;C:\\Program Files\\R\\R-3.6.0&quot;</code>, so I also tried putting <code>.Renviron</code> there. No luck</p>
  <p>Based on <a href="https://stackoverflow.com/questions/12291418/how-can-i-make-r-read-my-environmental-variables">this</a> I also tried <code>Sys.getenv(&quot;C:/Users/Administrator/Documents/.Renviron&quot;)</code>, but again no luck</p>