Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
3.1k views
in PowerShell by 12 13 22
How can I get the liste of all Environment Variables using PowerShell, for example, I need to know what's the specified value for computer name in the Environment Variables? How can I do that using Windows PowerShell?

1 Answer

1 like 0 dislike
by 163 204 403
selected by
 
Best answer

1) How to Get All Environment Variables in Windows?

  1. Righ click on the "My PC" icon > Select Manage
  2. In the opened dialog, click on "Advanced System Settings".
  3. Click on "Advanced" Tab > Environment Variables.
    Get All Environment Variables in Windows

2) How to Get All Environment Variables using PowerShell?

To Get All Environment Variables using PowerShell, you can run this cmdlet "dir env:" as the following:

  1. Open Windows PowerShell as Administrator.
  2. Type "dir env:" to show the list of all Environment Variables as below.
    How to Get All Environment Variables in PowerShell
If you don’t ask, the answer is always NO!
...