PowerShell is the single most useful skill for a Windows admin. Everything you click in Server Manager, Active Directory or IIS can be done – and repeated across a hundred servers – with PowerShell. You don’t need to be a programmer to start.
What you need: any Windows 10/11 or Windows Server machine. Open Windows PowerShell or install PowerShell 7 (
winget install Microsoft.PowerShell). Both work for this guide.
Commands are named Verb-Noun
PowerShell commands (cmdlets) follow one pattern: Verb-Noun.
| Verb | Meaning | Example |
|---|---|---|
| Get | Read something | Get-Service |
| Set | Change something | Set-Service |
| New | Create | New-Item |
| Remove | Delete | Remove-Item |
| Start / Stop | Start or stop | Start-Service, Stop-Process |
| Test | Check | Test-Connection, Test-Path |
Once you know the pattern, you can guess commands. Want to see processes? Get-Process. Restart a computer? Restart-Computer.
Find the command you need
Get-Command -Noun Service # everything that works with services
Get-Command *firewall* # anything with 'firewall' in the name
Get-Command -Verb Get -Module NetTCPIP
Read the help (it’s very good)
Update-Help -ErrorAction SilentlyContinue # download help once, as admin
Get-Help Get-Service
Get-Help Get-Service -Examples # jump straight to examples
Get-Help Get-Service -Online # open the web page
Get-Help about_* # concept topics, e.g. about_Pipelines
-Examples is the fastest way to learn a new cmdlet.
Parameters
Parameters change what a cmdlet does. They start with a dash:
Get-Service -Name Spooler
Get-Process -Name explorer
Get-ChildItem -Path C:\Windows -Filter *.log
Press Tab to complete cmdlet names, parameters and even values. It saves typing and prevents typos.
Safety habits from day one
-
-WhatIfshows what would happen without doing it:Get-ChildItem C:\Temp\*.tmp | Remove-Item -WhatIf -Confirmasks before each change.- Read before you write: run the
Get-version first, check the output, then addSet-orRemove-. - Run as Administrator only when the task needs it.
Aliases – fine to type, not in scripts
PowerShell has short aliases: ls and dir (Get-ChildItem), cd (Set-Location), cls (Clear-Host), gps (Get-Process). They’re handy at the prompt, but write full names in scripts so others can read them.
Get-Alias ls
Ten commands to try now
Get-Date
Get-ComputerInfo -Property OsName, OsVersion
Get-Service | Select-Object -First 10
Get-Process | Sort-Object CPU -Descending | Select-Object -First 5
Get-ChildItem C:\Windows\Temp
Test-Connection 8.8.8.8 -Count 2
Get-NetIPAddress -AddressFamily IPv4
Get-HotFix | Select-Object -First 5
Get-LocalUser
Get-History
FAQ
Windows PowerShell 5.1 or PowerShell 7? Windows PowerShell 5.1 is built into Windows and runs almost every admin module. PowerShell 7 is newer, faster and cross-platform. Learn on either – the skills transfer. Many admins keep both.
Why does my script say ‘running scripts is disabled’?
That’s the execution policy. For your own scripts, Set-ExecutionPolicy RemoteSigned -Scope CurrentUser is a common setting – follow your company’s policy.
What’s next
Next: The pipeline and objects – the idea that makes PowerShell powerful.
Practise this topic
Test yourself with free questions on this topic – instant answers and explanations.
Start practice questionsPowerShellBeginnerWindows AdminAutomation