Home / PowerShell
PowerShell
PowerShell taught as working commands: cmdlets and pipelines, variables and objects, functions and files, error handling and modules, ending with two real scripts. Every example is run with the real interpreter.
PowerShell is the shell that talks back in objects. You type a command, and instead of plain text you get real things with properties you can sort, filter, and count. This course starts with your first command and builds, one idea at a time, to functions, modules, and two finished scripts.
Course contents
Work top to bottom — the sidebar is the course. Topics later in the list assume the ones before them.
PowerShell Introduction
Beginner · ⏱ 2 min · standalone lesson
Getting Started
- PowerShell Getting Started
- PowerShell Cmdlets and Verbs
- PowerShell Getting Help
- PowerShell Aliases
- PowerShell Running Scripts
Variables and Data
- PowerShell Variables
- PowerShell Numbers
- PowerShell Strings
- PowerShell String Methods
- PowerShell Type Conversion
- PowerShell Constants and Read-Only Variables
Comparison and Logic
- PowerShell Comparison Operators
- PowerShell Boolean Logic
- PowerShell Matching Text
- PowerShell Testing Types and Null
Pipelines and Objects
- PowerShell Pipelines
- PowerShell Where-Object
- PowerShell Sort and Select
- PowerShell Measure and Count
- PowerShell Working with Objects
Conditionals
Start: PowerShell If Else ❯Loops
Start: PowerShell Foreach Loop ❯Arrays and Hashtables
- PowerShell Arrays
- PowerShell Array Methods
- PowerShell Ordered Hashtables
- PowerShell Hashtable Lookup
- PowerShell Nested Data
Functions
- PowerShell Writing Functions
- PowerShell Parameters
- PowerShell Default Values
- PowerShell Return Values
- PowerShell Pipeline Functions
Files and Folders
- PowerShell File Paths
- PowerShell Reading Files
- PowerShell Writing Files
- PowerShell Listing and Filtering
- PowerShell Organizing Files
Everyday Tools
Start: PowerShell Dates and Times ❯Modules and Scripts
Start: PowerShell Writing a Module ❯PowerShell Project: System Report
Beginner · ⏱ 6 min · standalone lesson
PowerShell Project: File Organizer
Beginner · ⏱ 6 min · standalone lesson
Learn PowerShell
PowerShell is a command-line shell and a scripting language from Microsoft. A shell is a program where you type commands instead of clicking buttons. PowerShell runs on Windows, macOS, and Linux, and the same commands work on each.
People learn PowerShell because it turns repetitive computer work into short scripts. Renaming a hundred files, checking a folder, or gathering a system report takes one script instead of an afternoon of clicking. The verb-noun names help too: Get-ChildItem gets items, and Sort-Object sorts them, so commands read like plain instructions.
PowerShell is taught here across 52 brief lessons. Each example was executed with the genuine PowerShell interpreter ahead of publication, so the output shown is the output the command truly gave. Each lesson closes with a practice question, and the solution walks through the reasoning behind it.
What you will learn
The path moves from one opening command to two whole scripts. Once you reach the final lesson, these are the skills you will have in PowerShell:
- Run commands and read help, and give your own commands short names with aliases.
- Store values in variables, work with numbers and text, and change a value into a different type.
- Compare values, combine tests with boolean logic, and match text with wildcards and patterns.
- Send results down a pipeline, and filter, sort, measure, and pick from them.
- Make choices with if and switch, and repeat work with foreach, for, and while loops.
- Keep lists in arrays and labelled values in ordered hashtables, and look values up by key.
- Group steps into functions with parameters, defaults, and return values, including functions that take pipeline input.
- Read and write files, list and filter folders, and move and copy files into place.
- Work with fixed dates, find your working directory, and handle errors without stopping a script.
- Package reusable commands into a module, and finish by building a system report and a file organizer.
Who this PowerShell course is for
This course is for anyone who uses a computer and wants the computer to do the repetitive parts. No programming experience is needed. The first lessons assume nothing beyond typing a command and reading what comes back.
It fits system administrators, support staff, and curious Windows users most directly, but the ideas travel: pipelines and objects show up in other shells and scripting languages too.
The 52 lessons add up to 165 minutes of lesson time, the sum of the per-lesson estimates. Work through them in order, a few at a time, and the later lessons build on the earlier ones.
How this course works
Work through the lessons top to bottom. Topics later in the list assume the ones before them, so a pipeline lesson expects you to know variables, and the module lessons expect you to know functions.
Every example shows its output. The output is the result the real interpreter printed, not a guess. When a lesson claims a number, the number on the page is the number the command produced.
Each lesson ends with an exercise. Try it before reading the answer. The answer explains why it is right, so a wrong guess still teaches something.
Progress is saved in your browser. When you come back, the course picks up where you left off.
Frequently asked questions
Is this PowerShell course free?
Yes. Every lesson on this page is free to read, and there is no account or payment anywhere in the course.
Do I need a Windows computer to learn PowerShell?
No. PowerShell runs on Windows, macOS, and Linux, and every example in this course was run on Linux. The same commands work on all three.
Is PowerShell a good first scripting language?
Yes, for a particular reason: its commands read like instructions, and its output is objects you can inspect. You see what a command returns before you learn to reshape it.
How long does it take to learn PowerShell basics?
This course holds 52 lessons totalling 165 minutes of lesson time. That covers the basics end to end: commands, pipelines, functions, files, and modules.
What is the difference between PowerShell and Bash?
Both are shells, but they pass different things along. Bash passes text between commands, and you cut that text apart yourself. PowerShell passes objects with named properties, so you filter and sort by property name instead of parsing text.
What can I build after this course?
The course ends with two real scripts: a system report and a file organizer. After that, the natural next step is writing small scripts for your own repetitive work, then learning the other shell in this catalog, Bash.
Next steps
- Bash ❯ — Bash runs 47 lessons through the other major shell. It passes text where PowerShell passes objects, so learning both shows what each style is good at.
- Python Beginner ❯ — Python Beginner runs 116 lessons through a general-purpose scripting language. It is the usual next step when a script outgrows one-liners and needs real programs.
- Go ❯ — Go runs 38 lessons through a small compiled language for building tools. It fits the moment your scripts grow into programs you want to share as single files.