Return value of environment variable with powershell

Question:

I have the name of an environment variable in a variable and I want to get the value. How do I do that? I’ve tried:

Answer:

Two lines

One line

Source:

Return value of environment variable with powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply