Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Environment vars by Power Shell

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

like image 900
Jacek Avatar asked Mar 16 '23 06:03

Jacek


2 Answers

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

like image 78
Rahul Tripathi Avatar answered Mar 18 '23 18:03

Rahul Tripathi


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.

like image 38
Leon Bambrick Avatar answered Mar 18 '23 18:03

Leon Bambrick