Free PowerShell tutorials
Learn PowerShell with Real Scripts and Examples
Step-by-step PowerShell tutorials for IT admins, sysadmins and developers. Every guide gives you a script you can copy, explains what each line does and shows the output, from your first command to automating files, Windows servers and SharePoint Online.
Get the Free 100 Cmdlets Ebook Start Learning PowerShell
- 700+Free tutorials
- 13×Microsoft MVP author
- 18+ yearsHands-on experience
- 7 & 5.1PowerShell versions tested
# Find .log files older than 30 days PS C:\Scripts> Get-ChildItem C:\Logs -Filter *.log | >> Where-Object LastWriteTime -lt (Get-Date).AddDays(-30) | >> Select-Object Name, LastWriteTime Name LastWriteTime ---- ------------- app-0712.log 7/12/2026 9:14:02 AM app-0713.log 7/13/2026 9:15:47 AM PS C:\Scripts>
- Copy-and-run scripts with the real output for every example
- Fixes for real error messages admins hit every day
- Kept up to date as PowerShell and Windows change
Where do you want to go?
Pick a PowerShell Learning Path
Follow the steps in order. Each one builds on the last, so by the end you can write the script yourself.
Beginner
New to PowerShell
Go from your first command to scripts with functions and error handling.
Automation
Automate files and folders
Find, copy, move and clean up files on a schedule, and log what your script did.
Sysadmin
Manage Windows computers
Check hardware, services, processes, updates and local users from the command line.
Microsoft 365
SharePoint Online with PnP
Connect to SharePoint Online and manage sites, lists, libraries and files in bulk.
Learn by topic
PowerShell Tutorials from Beginner to Advanced
Every topic starts with one main guide, followed by the related tutorials readers look for most.
Basics
PowerShell Tutorial for Beginners
Install and open PowerShell, run your first script and understand how commands, pipelines and execution policies work.
Cmdlets
PowerShell Commands with Examples
The cmdlets you will use every day, with syntax, parameters and a working example for each.
Variables
PowerShell Variables
Create, update and clear variables, and understand scope: local, global, script and private.
Data types
PowerShell Data Types
Work with strings, numbers, booleans, hashtables and objects, and convert safely between them.
Strings
PowerShell String Tutorials
Replace, split, trim, join and search text, including regex and multiline strings.
Arrays
PowerShell Array Tutorials
Create arrays and ArrayLists, add and remove items, loop through them, sort and find duplicates.
Files & folders
PowerShell Files and Folders
Create, read, copy, move, rename and delete files and folders, and search inside them.
Date & time
PowerShell DateTime Tutorials
Get the current date, add or subtract days, compare dates and format them exactly how you need.
Loops & conditions
PowerShell ForEach Loop
Repeat work with ForEach, For, While and Do loops, and make decisions with If and Switch.
Operators
PowerShell Comparison Operators
Compare values with
-eq,-ne,-gt,-like,-matchand-contains, and combine conditions with-andand-or.Functions & errors
Functions in PowerShell
Write reusable functions with parameters and return values, handle errors and package your code as a module.
Output
PowerShell Write-Host
Show results on screen, format them as tables and lists, and save output to text, CSV and log files.
CSV, JSON & XML
PowerShell Import-Csv
Read and write CSV, JSON, XML and Excel data, and convert between the formats.
Windows admin
Get Computer Information Using PowerShell
Check BIOS, disk space, memory, installed software, updates, services and local users.
Network & web
PowerShell Test-NetConnection
Test ports and connections, find IP addresses, call REST APIs and download files from a URL.
SharePoint
PowerShell SharePoint Tutorials
Automate SharePoint Online with PnP PowerShell: sites, lists, libraries, fields and documents.
Quick reference
PowerShell Cmdlets with Examples
The cmdlets you will reach for most. Each one opens a tutorial with the syntax, the common parameters and working examples.
Files & folders
Filter & shape objects
Text & data
System & network
Free PDF download
100 PowerShell Cmdlets with Examples
Keep the most useful PowerShell cmdlets in one handy PDF, each with a short explanation and an example you can run. Enter your email and the ebook is sent straight to your inbox.
You’ll also get new PowerShell tutorials by email. Unsubscribe anytime.Troubleshooting
Fix Common PowerShell Errors
Seeing a red error message? Find it below for the cause and the exact steps that fix it, plus quick answers to the questions every new PowerShell user asks.
Error messages
- Running scripts is disabled on this system
- The file is not digitally signed
- Install-Module is not recognized
- Access to the path is denied
- Cannot index into a null array
- Cannot convert value to type System.Int32
- Cannot convert value to type System.String
- The RPC server is unavailable
- Error while enumerating through a collection
- Current site is not a tenant administration site
- PowerShell keeps popping up
What’s the difference?
Bookmark these
Essential PowerShell Tutorials
- Try Catch in PowerShellError handling
- PowerShell Where-ObjectCmdlets
- Find Text Patterns with Select-StringText
- PowerShell RegexStrings
- PowerShell String ReplaceStrings
- PowerShell Export-CsvData
- PowerShell Invoke-WebRequestWeb
- Get Folder Size Including SubfoldersFiles
- PowerShell Get-DateDate & time
- ForEach-Object vs foreachLoops
- PowerShell Random Password GeneratorScripts
- Send Email to Multiple RecipientsScripts
Recently published
Latest PowerShell Tutorials
Why you can trust these tutorials
How We Write and Test Every Script
Real admin tasks
Topics come from real work and real questions: automating files, managing Windows computers and SharePoint Online, and the errors that stop a script from running.
Every script is run first
Each script is run on both PowerShell 7 and Windows PowerShell 5.1 before it is published. Where the two versions behave differently, the tutorial says so.
PowerShell 7Windows PowerShell 5.1
Output you can check
You see the command, an explanation of what each part does and the actual output or screenshot, so you know what to expect on your own computer.
Kept up to date
Tutorials are reviewed and updated when PowerShell, Windows or Microsoft 365 changes, so older guides do not quietly stop working.
Found a script that doesn’t work or a step that’s out of date? Email bijay@powershellfaqs.com and it will be checked and fixed.
PowerShell FAQs
Frequently Asked PowerShell Questions
What is PowerShell used for?
PowerShell is Microsoft’s command-line shell and scripting language. IT admins and developers use it to automate repetitive work: managing files, users, services and Windows settings, working with CSV and JSON data, and administering Microsoft 365, SharePoint Online and Azure. Unlike older shells, it passes full .NET objects through the pipeline instead of plain text.
Is PowerShell a programming language?How do I check which version of PowerShell I have?
Open PowerShell and run $PSVersionTable.PSVersion. Version 5.1 is Windows PowerShell, which is built into Windows. Version 7 or later is the newer, cross-platform PowerShell.
What is the difference between Windows PowerShell 5.1 and PowerShell 7?
Windows PowerShell 5.1 ships with Windows, runs on .NET Framework and starts with powershell.exe. It still gets security fixes but no new features. PowerShell 7 runs on modern .NET, works on Windows, macOS and Linux, starts with pwsh.exe and adds features such as the ternary operator and ForEach-Object -Parallel. The two can be installed side by side.
Why does PowerShell say “running scripts is disabled on this system”?
Windows blocks scripts by default through the execution policy. For your own account, running Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser lets local scripts run while scripts downloaded from the internet still need a trusted signature.
Is PowerShell better than CMD?
For automation, yes. CMD works with text, while PowerShell works with objects, so you can filter, sort and export results without parsing strings. PowerShell can also run most CMD commands, so you do not lose anything by switching.
Windows PowerShell vs CMDHow do I run a PowerShell script?
Save your code in a file with the .ps1 extension, open PowerShell in that folder and run it with .\script.ps1. You can pass values to the script as parameters, for example .\script.ps1 -Path C:\Logs.
