# Variables and Values

Store values in variables, write text, numbers and dates, keep lists and lookups, and read the environment variables every program can see.

Updated: November 10, 2026

## [Values](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-values)

1. [Variables: \`$name\`](https://www.ask-codey.com/lessons/powershell-variables) (Apprentice): A variable is a name PowerShell keeps a value under, so $owl = "…" stores a long path once, $drawings = Get-ChildItem … keeps a whole list of files, and $owl hands the value back in any later command until you close the window.
2. [Text: Quotes and \`$( )\`](https://www.ask-codey.com/lessons/powershell-strings) (Apprentice): Double quotes fill in the values of variables and single quotes keep text exactly as typed, $( ) puts a property or a whole command's answer into text, and a here-string holds text of many lines.
3. [Numbers, Dates and Types](https://www.ask-codey.com/lessons/powershell-types) (Apprentice): Every value in PowerShell has a type, such as a whole number, text or a date; \[int\], \[decimal\] and \[datetime\] turn text into the type you need, and subtracting dates, AddDays and Get-Date -Format answer questions such as how many days are left until a trip.
4. [Lists and Lookups: Arrays and Hashtables](https://www.ask-codey.com/lessons/powershell-arrays-and-hashtables) (Journeyman): An array keeps several values in order, made with commas or @( ) and read by position from \[0\], and a hashtable, made with @{ }, keeps values under names so you can look one up by its name, the way you'd find a word in a dictionary.

## [The Environment](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-the-environment)

1. [Environment Variables and \`PATH\`](https://www.ask-codey.com/lessons/powershell-environment-variables) (Apprentice): Environment variables are settings Windows hands to every program, read and set in PowerShell with $env:, and PATH is the one that lists the folders searched for a command, which is why a program outside them is not recognized until you run it by its path or add its folder for this session.

## [Exercise: The Workshop's Machines](https://www.ask-codey.com/courses/powershell-in-depth/topics/exercise-powershell-the-workshops-machines)

1. [Exercise: The Workshop's Machines](https://www.ask-codey.com/lessons/exercise-powershell-the-workshops-machines) (Apprentice): Mind an inventor's workshop with variables, quotes, dates, arrays, hashtables and environment variables, from counting her machines to oiling the gears by name from your PATH, while a Pester check reads the eight results.

Source: https://www.ask-codey.com/courses/powershell-in-depth/chapters/powershell-variables-and-values
