PowerShell for Beginners

If you've used Windows for years and still open the old cmd.exe for command-line tasks, you're missing out on a tool that completely changed how a Microsoft system gets administered: PowerShell. And contrary to what a lot of people think, it isn't just a "better prompt" — it's an object-oriented scripting language that runs on Windows, Linux and macOS. Let's go from zero to your first useful script in under 10 minutes.
What Makes PowerShell Different
Created in 2006 by Jeffrey Snover at Microsoft, PowerShell was built on top of .NET and introduced a revolutionary concept compared to cmd: instead of passing text between commands, it passes objects. That changes everything.
When you run Get-Process in PowerShell, what comes back isn't a table formatted as a string — it's a collection of System.Diagnostics.Process objects, each with properties like Name, CPU, Id, WorkingSet. That means filtering, sorting and extracting data becomes dramatically simpler and more reliable than wrangling grep and awk over text output.
In 2016, Microsoft open-sourced PowerShell Core (today just PowerShell 7+), which runs cross-platform. So yes: you can use the same scripts on Windows Server and inside a Linux container.
Opening the Terminal and Getting Your Bearings
On Windows 10/11, press Win + X and choose "Terminal (Admin)" or "Windows PowerShell." The recommended modern version is PowerShell 7+, installable via the Microsoft Store or winget install Microsoft.PowerShell.
Cmdlets follow a Verb-Noun pattern — extremely predictable. Want to list something? Get-. Want to create something? New-. Want to remove something? Remove-. That consistency is one of the biggest advantages over cmd.
# List files and folders in the current directory
Get-ChildItem
# Same result, with a familiar alias (yes, ls works)
ls
# Navigate between directories
Set-Location C:\Users\YourUsername
# Create a new folder
New-Item -ItemType Directory -Name "MyFolder"
# Read the contents of a file
Get-Content .\file.txt
# Discover ALL available cmdlets for processes
Get-Command -Noun Process
The Object Pipeline in Practice
This is where PowerShell shines. The | (pipe) operator passes entire objects between cmdlets. Here's a real example: I want to find the 5 processes consuming the most CPU on my machine and export them to CSV.
Get-Process |
Sort-Object CPU -Descending |
Select-Object -First 5 Name, Id, CPU, WorkingSet |
Export-Csv -Path ".\top-processes.csv" -NoTypeInformation
Four lines, zero text parsing. Try doing that in cmd — you'll want to cry.
Another useful example: stopping every frozen Chrome process.
Get-Process -Name "chrome" |
Where-Object { $_.Responding -eq $false } |
Stop-Process -Force
$_ is the current object inside the pipeline. Where-Object filters; Stop-Process terminates. Readable even if you've never touched PowerShell before.
Your First .ps1 Script
Create a file called backup-docs.ps1 with the content below:
$source = "$env:USERPROFILE\Documents"
$destination = "D:\Backups\Documents_$(Get-Date -Format 'yyyy-MM-dd')"
New-Item -ItemType Directory -Path $destination -Force | Out-Null
Copy-Item -Path $source\* -Destination $destination -Recurse -Force
Write-Host "Backup completed at $destination" -ForegroundColor Green
On the first run, Windows might complain about execution policy. Allow local scripts to run (as admin):
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
After that, just run .\backup-docs.ps1 and your documents get copied into a folder stamped with the date. Schedule it in Task Scheduler and you've got automatic backups without spending a penny.
Why It's Worth Learning in 2026
- Real automation: repetitive 20-minute tasks become 30-second scripts
- Windows administration: users, permissions, Active Directory, services, GPOs — all handled via PowerShell (including auditing security logs)
- Azure and Microsoft 365: the
Azmodule andExchangeOnlineManagementare practically essential in a corporate environment - DevOps: GitHub Actions, Azure Pipelines and CI scripts on Windows frequently rely on PowerShell
- Cross-platform: PowerShell 7+ runs on Linux and macOS — you can manage a mixed fleet with the same language
The learning curve is moderate — you'll feel productive within a few days and confident within a few weeks. For anyone living in Windows environments, few investments pay off this quickly.
What tedious task do you still do by hand every week and have never automated? Tell us in the comments — the next post might be exactly the script you need.




Comments