Skip to content
Tutorials Center
My learning

Topics

PowerShell Tutorial

Learn PowerShell step by step: 34 lessons in 8 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is PowerShell? Learn what PowerShell is, how it differs from classic shells, why it passes objects instead of text, and how Windows PowerShell 5.1 differs from PowerShell 7.
  2. 2 Installing and Your First Commands Install PowerShell 7, choose between pwsh and powershell.exe, set up Windows Terminal or VS Code, and run first commands like Get-Date and Write-Output.
  3. 3 Cmdlets and the Verb-Noun Pattern Understand PowerShell cmdlets: the approved Verb-Noun naming, Get-Command discovery, named and positional parameters, switch parameters and aliases.
  4. 4 Getting Help Learn to teach yourself PowerShell: Get-Help with -Examples and -Full, Update-Help, reading syntax, Get-Member, about_ topics and Get-Command -Syntax.

Objects and the Pipeline

  1. 5 Objects, Properties and Methods Learn how PowerShell objects work: .NET types, reading properties with dot notation, calling methods, static members, Get-Member and Select-Object -ExpandProperty.
  2. 6 The Pipeline Understand the PowerShell pipeline: how the pipe passes objects one at a time, why it streams, which cmdlets block, and how ByValue and ByPropertyName binding work.
  3. 7 Where-Object, Select-Object and Sort-Object Filter, reshape and sort objects in the PowerShell pipeline: Where-Object, Select-Object (-First, -Unique, calculated properties) and Sort-Object, with examples.
  4. 8 Group-Object, Measure-Object and ForEach-Object Summarize objects in PowerShell: group and count with Group-Object, total and average with Measure-Object, and run code per object with ForEach-Object.
  5. 9 Formatting and Output Control how PowerShell shows and saves objects: Format-Table, Format-List, Out-String, Out-File and Export-Csv, and why formatting must always come last.

Language Basics

  1. 10 Variables and Types Learn PowerShell variables: $name syntax, strong typing with [int] and [string], type accelerators, casting rules, automatic variables, scopes and $null.
  2. 11 Strings, Quoting and Here-Strings Master PowerShell strings: single vs double quotes, $() subexpressions, backtick escapes, here-strings, the -f format operator, and -join / -split with regex.
  3. 12 Operators and Comparison Learn PowerShell comparison operators -eq, -like, -match, -contains and -in, case sensitivity, array-on-the-left filtering, logical operators, ternary and ??.
  4. 13 Arrays and Hashtables Learn PowerShell arrays and hashtables: ranges, indexing, why += is slow, List[T], ordered hashtables, key lookup and a first look at splatting.
  5. 14 Conditionals and Loops Learn PowerShell control flow: if and elseif, truthiness, switch with wildcards and regex, foreach, for, while, do loops, break, continue and labels.

Functions and Scripts

  1. 15 Functions and Parameters Write PowerShell functions with param blocks, defaults, typed and switch parameters, and learn why return is not the only way a function gives output.
  2. 16 Advanced Functions Turn PowerShell functions into cmdlet-like tools with CmdletBinding, mandatory and validated parameters, pipeline input, begin/process/end and -WhatIf.
  3. 17 Scripts and Execution Policy Learn to save PowerShell code as .ps1 scripts, run them with the call operator, dot source libraries, use $PSScriptRoot, and understand execution policy.
  4. 18 Modules and Profiles Learn how PowerShell modules are found, imported and installed from the Gallery, how to write a simple .psm1 module, and how to customize $PROFILE.

Files, Data and Errors

  1. 19 Working with Files and Folders Learn how PowerShell works with files and folders: providers, Get-ChildItem, Copy-Item, Move-Item, Remove-Item, Test-Path, Get-Content and Set-Content.
  2. 20 CSV, JSON and XML Read and write structured data in PowerShell with Import-Csv, Export-Csv, ConvertFrom-Json, ConvertTo-Json -Depth and Select-Xml, and avoid the common traps.
  3. 21 Errors, try/catch and ErrorAction Understand PowerShell terminating and non-terminating errors, -ErrorAction, $ErrorActionPreference, try/catch/finally and the $Error list, with runnable models.
  4. 22 Regular Expressions and Text Processing Use regular expressions in PowerShell: the -match and -replace operators, the $Matches variable, Select-String, named groups and [regex]::Matches for log files.

Real-World Use

  1. 23 Processes, Services and the System Manage processes, services, event logs and scheduled tasks with PowerShell: Get-Process, Stop-Process, Get-Service, Get-WinEvent and Get-CimInstance explained.
  2. 24 Remoting, Jobs and Parallelism Run PowerShell on other machines with Enter-PSSession, Invoke-Command and SSH, and run work in the background with Start-Job, thread jobs and ForEach-Object -Parallel.
  3. 25 Web Requests and REST APIs Call web APIs from PowerShell: Invoke-RestMethod vs Invoke-WebRequest, headers, JSON bodies, bearer tokens, error handling, pagination and retry with backoff.
  4. 26 Security and Secrets Write safer PowerShell: what SecureString really protects, SecretManagement, least privilege, constrained language mode, script block logging and injection pitfalls.
  5. 27 Testing and Style with Pester Test PowerShell with Pester 5: Describe, It, Should, BeforeAll, mocks and TestDrive, then lint with PSScriptAnalyzer and follow naming and style conventions.

Projects

  1. 28 Project: Disk and Folder Report Build a disk and folder report in PowerShell: scan files, group by extension, bucket by size, sort, format readable sizes and export to CSV. Includes a runnable JS model.
  2. 29 Project: Log Analyzer Build a log analyzer in PowerShell: parse lines with a named-group regex, count by level, find the top repeated errors and return one summary object. Python stand-in included.
  3. 30 Project: File Organizer Build a safe file organizer in PowerShell: classify files by extension, preview with -WhatIf, handle name collisions and keep an undo log. Includes a virtual file system model.
  4. 31 Project: Bulk User Report from CSV Build a PowerShell report from a CSV of users: import, validate rows, collect rejects, add calculated properties, then write JSON and HTML output.

Practice and Review

  1. 32 Practice Exercises with Solutions Twelve graded PowerShell exercises on the pipeline, functions, errors and files, each with a read-only PowerShell solution and a runnable JavaScript equivalent.
  2. 33 PowerShell Interview Questions 26 PowerShell interview questions with short answers: objects, the pipeline, errors, scope, functions, remoting, jobs and security, with two runnable stand-ins.
  3. 34 PowerShell Cheat Sheet A one-page PowerShell cheat sheet: syntax, operators, quoting, collections, common cmdlets, errors, remoting and a table of the pitfalls that catch everyone.