How To Access Environment Variables In PowerShell

How To Access Environment Variables In PowerShell

Because I can never seem to remember this stuff.


Magical Environment Variable:


Doesn’t do much on its own though.

List all available properties:

Get-ChildItem $Env:

Note to self: Remember to put that blasted colon at the end, and it will save you hours of figuring out why it lists your current folders instead.

Notable Properties

Get the local computer name:


Get the processor attributes:


Get the Operating System type:


Get the executable search path (just like PATH in DOS):


Get the TEMP path:


Get user related information:


Get the program files folders:

Jorge Candeias's Picture

About Jorge Candeias

Jorge helps organizations build high-performing solutions on the Microsoft tech stack.

London, United Kingdom