4

How can I get environmet variables by Power Shell? What command should I execute. I use Windows 8.1

2 Answers 2

4

You can try this command:

Get-ChildItem Env:

Output:

Name                           Value
----                           -----
Path                           D:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\...
TEMP                           C:\DOCUME~1\kmyer\LOCALS~1\Temp
SESSIONNAME                    Console
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PS1;.PSC1
USERDOMAIN                     WINGROUP
PROCESSOR_ARCHITECTURE         x86
SystemDrive                    C:
APPDATA                        C:\Documents and Settings\kmyer\Application Data
windir                         C:\WINDOWS
USERPROFILE                    C:\Documents and Settings\kmyer

Also check Windows PowerShell Tip of the Week

Sign up to request clarification or add additional context in comments.

Comments

3

For a given environment variable, such as Path, reference it like this:

$env:Path

To see all of the environment variables you can visit the Ps-Drive "env:"

cd env:

Therein you can see and change all of the environment variables.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.