Introduction

PowerShell is Microsoft's object-oriented, cross-platform shell and scripting language that pipes structured .NET objects, rather than plain text, between its Verb-Noun commands called cmdlets.

Learn Python, JavaScript, Java and more with free interactive lessons, real projects and AI-powered help. Beginner-friendly.

Part of the free Powershell course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.

By the end of this lesson you'll understand what makes PowerShell special — it pipes objects , not text — read and write your first Verb-Noun cmdlets, and use Get-Help and Get-Command to teach yourself any command you'll ever need.

Think of an old shell like bash as handing you a printed newspaper : you get a wall of text, and to find one fact you scan and cut out the right words by hand. PowerShell hands you a spreadsheet instead — rows, columns, and labelled cells. To get the busiest process you don't slice text; you simply say "sort by the CPU column and give me the top 3". Because PowerShell moves real objects (data with named properties) between commands rather than raw text, you ask for things by name — and your commands stop breaking the moment a layout changes.

1. What PowerShell Is (and Your First Cmdlets)

PowerShell is Microsoft's object-oriented, cross-platform shell and scripting language . A shell is a program that runs commands you type; "object-oriented" means each command hands back structured data (built on .NET) rather than plain text. The commands are called cmdlets (pronounced "command-lets"), and you'll meet three of the most common ones below: Write-Output prints a value, Get-Date returns the current date/time, and (later) Get-Process lists running programs. Read this worked example, run it, and confirm your output matches.

Now you try. The script below is almost complete — fill in the two blanks marked ___ using the hints in the # comments, then run it.

2. The Big Idea: Objects, Not Text

This is what sets PowerShell apart from bash, CMD, or zsh. In those shells, a command's output is just text , so to use part of it you slice the text by counting spaces with tools like cut or awk — and it breaks the instant a column shifts. PowerShell sends objects down the pipeline (the | symbol, read as "pipe into"). An object carries named properties — a process object has Name , Id , and CPU — so you ask for data by name. Compare the two approaches in the comments below.

Your turn again. Memory usage lives in a property called WS (working set). Finish the pipeline by adding the cmdlet that picks which rows and columns to keep.

The bash column relies on the output's exact spacing; the PowerShell column names the data directly, so it keeps working when the display changes.

3. Verb-Noun Naming & Teaching Yourself

Every cmdlet is named Verb-Noun : an approved verb plus a singular noun. Get-Process reads processes; Stop-Process ends one; Get-Date reads the date. Learn the common verbs — Get , Set , New , Remove — and you can often guess a command before looking it up. When you can't guess, three cmdlets let PowerShell teach you: Get-Command finds cmdlets by pattern, Get-Help explains one (add -Examples for copy-paste usage), and Get-Member reveals an object's properties so you know what you can sort or select by.

No blanks this time — just a brief and an outline. Build the pipeline yourself from the cmdlets you met in this lesson, run it, and compare the shape of your table to the expected result in the comments.

Practice quiz

What does PowerShell pass between commands in its pipeline?

  • Plain text lines
  • Structured objects
  • Raw bytes
  • HTML fragments

Answer: Structured objects. Unlike bash, PowerShell pipes structured .NET objects with named properties.

Which naming convention do all cmdlets follow?

  • Noun-Verb
  • Verb only
  • Noun.Verb
  • Verb-Noun

Answer: Verb-Noun. Every cmdlet is named Verb-Noun, like Get-Process or Stop-Service.

Which cmdlet returns the current date and time?

  • Get-Date
  • Show-Time
  • Read-Clock
  • Get-Now

Answer: Get-Date. Get-Date returns a DateTime object representing the current date and time.

What symbol is the pipeline operator?

  • &
  • >
  • |
  • %

Answer: |. The | symbol pipes one cmdlet's output into the next cmdlet.

Which cmdlet sends a value down the pipeline?

  • Print-Line
  • Echo-Text
  • Write-Output
  • Say-Value

Answer: Write-Output. Write-Output sends an object down the pipeline so the next command can use it.

Which cmdlet finds other cmdlets by pattern?

  • Get-Command
  • Find-Cmdlet
  • Search-Help
  • List-Commands

Answer: Get-Command. Get-Command finds cmdlets, e.g. Get-Command *Process*.

Which cmdlet lists an object's properties and methods?

  • Get-Property
  • Show-Object
  • Get-Detail
  • Get-Member

Answer: Get-Member. Get-Member reveals the properties and methods available on an object.

How do you sort process objects by their CPU property, highest first?

  • Order-By CPU
  • Arrange CPU -Down
  • Sort-Object CPU -Descending
  • Get-Process -SortCPU

Answer: Sort-Object CPU -Descending. Sort-Object CPU -Descending sorts objects by the named CPU property, largest first.

Is PowerShell case-sensitive when typing cmdlet names?

  • Yes, always
  • No, it is case-insensitive
  • Only for nouns
  • Only for verbs

Answer: No, it is case-insensitive. PowerShell is case-insensitive, so get-process and Get-Process both work.

What does Set-ExecutionPolicy RemoteSigned help with?

  • Speeding up cmdlets
  • Renaming cmdlets
  • Hiding the prompt
  • Allowing your own scripts to run

Answer: Allowing your own scripts to run. It lets your own local .ps1 scripts run while still requiring downloaded ones to be signed.