title: Display all environment variables from a running PowerShell script
body: <p>I need to display all configured environment variables in a PowerShell script at runtime. Normally when displaying environment variables I can just use one of the following at the shell (among other techniques, but these are simple):</p>
  
  <pre><code>gci env:*
  ls Env:
  </code></pre>
  
  <p>However, I have a script being called from another program, and when I use one of the above calls in the script, instead of being presented with environment variables and their values, I instead get a list of <code>System.Collections.DictionaryEntry</code> types instead of the variables and their values. Inside of a PowerShell script, how can I display all environment variables?</p>