Jacek
Jacek

Reputation: 12053

Environment vars by Power Shell

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

Upvotes: 4

Views: 164

Answers (2)

Leon Bambrick
Leon Bambrick

Reputation: 26306

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.

Upvotes: 3

Rahul Tripathi
Rahul Tripathi

Reputation: 172448

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

Upvotes: 4

Related Questions