Cmdlet reference
PowerShell Commands with Examples
The PowerShell commands you’ll use most, grouped by task. Each one has a plain-English description, a copy-ready example and a link to a full tutorial or Microsoft’s documentation.
Browse the commands Get the 100 cmdlets PDF
- 91Commands with examples
- 11Task groups
- 38Aliases explained
- 7 & 5.1Examples checked in both
Updated September 30, 2026
# Find every command that works with services PS C:\> Get-Command -Noun Service | Select-Object -Property Name Name ---- Get-Service New-Service Remove-Service Restart-Service Resume-Service Set-Service Start-Service Stop-Service Suspend-Service PS C:\>
Read any command
How PowerShell Commands Work
PowerShell commands are called cmdlets. Once you know these four ideas, you can read almost any script.
Verb-Noun names
The verb says what happens and the noun says to what:
Get-Service,Stop-Process. Microsoft keeps a list of approved verbs.Parameters
Options start with a dash, like
-Pathor-Recurse. Press Tab to complete names as you type.The pipeline
The
|passes objects, not text, from one command to the next:Get-Service | Sort-Object Status.Aliases
Short names like
lsandcdrun full cmdlets. Handy at the prompt, but use full names in scripts.
- 1. Find a command
Get-Command *-Item
Lists every command whose name ends in -Item. - 2. Learn how to use it
Get-Help Copy-Item -Examples
Shows ready-made examples for that command. - 3. See what it returns
Get-Item C:\Windows | Get-Member
Lists the properties you can select, sort or filter on.
Microsoft explains the basics in Discover PowerShell commands. New to PowerShell? Start with the step-by-step learning path.
The command list
PowerShell Commands by Category
Each example uses real parameters that exist in both PowerShell 7 and Windows PowerShell 5.1. Commands that change or delete things include -WhatIf, so you can try them safely.
- Find commands and get help5
- Files and folders17
- Filter, sort and shape objects9
- Show output and ask for input8
- CSV, JSON and HTML data6
- Processes and services7
- Windows system information12
- Network and web7
- Variables and environment6
- Users, security and scripts8
- Remoting and modules6
Find commands and get help
Three commands that teach you every other command. Learn these first.
- Get-CommandFinds commands by name, verb, noun or module.
Get-Command -Noun Service
Docs - Get-HelpShows help, syntax and examples for any command.
Get-Help Get-ChildItem -Examples
Docs - Get-MemberLists the properties and methods of the objects a command returns.
Get-Process | Get-Member -MemberType Property
Tutorial Docs - Get-AliasShows which command an alias such as ls or cd runs.
Get-Alias -Name ls, cd, cat
Docs - Get-HistoryLists the commands you've run in the current session.
Get-History -Count 10
Tutorial Docs
Files and folders
Navigate, create, copy, move, read and delete files and folders.
- Get-ChildItemLists files and folders, with filters and recursion.
Get-ChildItem -Path C:\Reports -Filter *.csv -Recurse
Tutorial Docs - Set-LocationChanges the current folder (cd).
Set-Location -Path C:\Reports
Tutorial Docs - Get-LocationShows the current folder (pwd).
Get-Location
Tutorial Docs - New-ItemCreates a file or folder.
New-Item -Path C:\Reports\2026 -ItemType Directory
Tutorial Docs - Copy-ItemCopies files and folders.
Copy-Item -Path C:\Reports\*.csv -Destination D:\Backup
Tutorial Docs - Move-ItemMoves files and folders.
Move-Item -Path C:\Reports\old.csv -Destination C:\Archive
Tutorial Docs - Rename-ItemRenames a file or folder.
Rename-Item -Path C:\Reports\sales.csv -NewName sales-2026.csv
Tutorial Docs - Remove-ItemDeletes files and folders.
Remove-Item -Path C:\Temp\*.log -WhatIf
Tutorial Docs - Test-PathChecks whether a file or folder exists.
Test-Path -Path C:\Reports\sales.csv
Tutorial Docs - Get-ContentReads a text file, line by line.
Get-Content -Path C:\Logs\app.log -Tail 20
Tutorial Docs - Set-ContentWrites text to a file, replacing what's there.
Set-Content -Path C:\Reports\note.txt -Value 'Done'
Tutorial Docs - Add-ContentAppends text to the end of a file.
Add-Content -Path C:\Logs\run.log -Value (Get-Date)
Tutorial Docs - Get-ItemGets one file or folder and its properties.
(Get-Item -Path C:\Reports\sales.csv).LastWriteTime
Tutorial Docs - Get-FileHashCalculates a file's hash to check it hasn't changed.
Get-FileHash -Path .\setup.exe -Algorithm SHA256
Tutorial Docs - Split-PathGets the folder or file name part of a path.
Split-Path -Path C:\Reports\sales.csv -Leaf
Tutorial Docs - Unblock-FileRemoves the downloaded-from-internet block from files.
Get-ChildItem -Path .\Scripts | Unblock-File
Tutorial Docs - Compress-ArchiveCreates a .zip file from files or folders.
Compress-Archive -Path C:\Reports\* -DestinationPath C:\reports.zip
Docs
Filter, sort and shape objects
The pipeline commands that turn raw output into exactly what you need.
- Where-ObjectKeeps only the objects that match a condition.
Get-Service | Where-Object Status -eq 'Running'
Tutorial Docs - Select-ObjectPicks properties, or the first or last few objects.
Get-Process | Select-Object -First 5 -Property Name, CPU
Tutorial Docs - Sort-ObjectSorts objects by one or more properties.
Get-ChildItem | Sort-Object -Property Length -Descending
Tutorial Docs - ForEach-ObjectRuns a script block for every object in the pipeline.
1..5 | ForEach-Object { $_ * 10 }Tutorial Docs - Group-ObjectGroups objects that share a property value.
Get-Service | Group-Object -Property Status
Docs - Measure-ObjectCounts objects and sums, averages or finds min and max.
Get-ChildItem | Measure-Object -Property Length -Sum
Tutorial Docs - Compare-ObjectShows the differences between two lists.
Compare-Object -ReferenceObject $list1 -DifferenceObject $list2
Tutorial Docs - Select-StringSearches text and files for a pattern, like grep.
Select-String -Path C:\Logs\*.log -Pattern 'error'
Tutorial Docs - Tee-ObjectSaves output to a file and passes it on.
Get-Process | Tee-Object -FilePath C:\Temp\procs.txt
Tutorial Docs
Show output and ask for input
Display results, format them and read what the user types.
- Write-HostWrites colored text straight to the screen.
Write-Host 'Backup complete' -ForegroundColor Green
Tutorial Docs - Write-OutputSends objects down the pipeline (the default output).
Write-Output 'Processing 42 files'
Tutorial Docs - Format-TableShows output as a table with chosen columns.
Get-Service | Format-Table -Property Name, Status -AutoSize
Tutorial Docs - Format-ListShows each property on its own line.
Get-Process -Id $PID | Format-List -Property *
Tutorial Docs - Out-FileSaves output to a text file.
Get-Service | Out-File -FilePath C:\Reports\services.txt
Tutorial Docs - Out-GridViewOpens output in an interactive, filterable window.
Get-Process | Out-GridView
Tutorial Docs - Read-HostPrompts the user to type a value.
$name = Read-Host -Prompt 'Enter your name'
Tutorial Docs - Start-TranscriptRecords everything in the session to a log file.
Start-Transcript -Path C:\Logs\session.txt
Tutorial Docs
CSV, JSON and HTML data
Import, export and convert structured data.
- Import-CsvReads a CSV file into objects, one per row.
Import-Csv -Path C:\Data\users.csv
Tutorial Docs - Export-CsvSaves objects to a CSV file.
Get-Process | Export-Csv -Path C:\Reports\procs.csv -NoTypeInformation
Tutorial Docs - ConvertTo-JsonTurns objects into JSON text.
Get-Service -Name Spooler | ConvertTo-Json -Depth 2
Tutorial Docs - ConvertFrom-JsonTurns JSON text into objects.
Get-Content -Path .\config.json -Raw | ConvertFrom-Json
Tutorial Docs - ConvertTo-HtmlTurns objects into an HTML table or report.
Get-Service | ConvertTo-Html -Property Name, Status | Out-File services.html
Tutorial Docs - ConvertTo-CsvTurns objects into CSV text without writing a file.
Get-Date | ConvertTo-Csv -NoTypeInformation
Tutorial Docs
Processes and services
See what's running, then start, stop and configure it.
- Get-ProcessLists running processes with CPU and memory use.
Get-Process -Name chrome, msedge
Tutorial Docs - Start-ProcessStarts a program, optionally as administrator.
Start-Process -FilePath notepad.exe
Tutorial Docs - Stop-ProcessStops a process by name or ID.
Stop-Process -Name notepad -WhatIf
Tutorial Docs - Get-ServiceLists Windows services and their status.
Get-Service -Name Spooler, W32Time
Tutorial Docs - Restart-ServiceStops and starts a service.
Restart-Service -Name Spooler -WhatIf
Tutorial Docs - Set-ServiceChanges a service's startup type.
Set-Service -Name Spooler -StartupType Automatic -WhatIf
Tutorial Docs - Start-JobRuns a command in the background.
Start-Job -ScriptBlock { Get-ChildItem C:\ -Recurse }Docs
Windows system information
Check the computer, its hardware, updates, events and settings.
- Get-ComputerInfoGets Windows, hardware and BIOS details.
Get-ComputerInfo -Property OsName, OsVersion, CsTotalPhysicalMemory
Tutorial Docs - Get-CimInstanceQueries Windows (WMI) classes, such as disks and BIOS.
Get-CimInstance -ClassName Win32_OperatingSystem
Tutorial Docs - Get-DateGets the current date and time, or formats a date.
Get-Date -Format 'yyyy-MM-dd'
Tutorial Docs - Get-WinEventReads Windows event logs.
Get-WinEvent -LogName System -MaxEvents 20
Tutorial Docs - Get-HotFixLists installed Windows updates.
Get-HotFix | Sort-Object -Property InstalledOn
Tutorial Docs - Get-PSDriveLists drives, including free and used space.
Get-PSDrive -PSProvider FileSystem
Tutorial Docs - Get-ScheduledTaskLists scheduled tasks.
Get-ScheduledTask | Where-Object State -eq 'Ready'
Tutorial Docs - Get-PrinterLists installed printers.
Get-Printer | Select-Object -Property Name, DriverName
Tutorial Docs - Get-TimeZoneShows the time zone (Set-TimeZone changes it).
Get-TimeZone
Tutorial Docs - Restart-ComputerRestarts a local or remote computer.
Restart-Computer -ComputerName PC-SALES-07 -WhatIf
Tutorial Docs - Rename-ComputerRenames the computer.
Rename-Computer -NewName PC-SALES-08 -WhatIf
Tutorial Docs - Get-WindowsOptionalFeatureLists optional Windows features (needs admin).
Get-WindowsOptionalFeature -Online | Where-Object State -eq 'Enabled'
Tutorial Docs
Network and web
Test connections, check IP settings and call web APIs.
- Test-ConnectionPings a computer, like ping.
Test-Connection -ComputerName learn.microsoft.com -Count 2
Docs - Test-NetConnectionTests a TCP port and the route to a host.
Test-NetConnection -ComputerName learn.microsoft.com -Port 443
Tutorial Docs - Get-NetIPAddressShows the computer's IP addresses.
Get-NetIPAddress -AddressFamily IPv4
Tutorial Docs - Get-NetTCPConnectionLists TCP connections and listening ports.
Get-NetTCPConnection -State Listen
Tutorial Docs - Resolve-DnsNameLooks up DNS records, like nslookup.
Resolve-DnsName -Name learn.microsoft.com
Docs - Invoke-WebRequestDownloads a web page or file over HTTP.
Invoke-WebRequest -Uri https://example.com -OutFile page.html
Tutorial Docs - Invoke-RestMethodCalls a REST API and turns JSON into objects.
Invoke-RestMethod -Uri https://api.github.com/repos/PowerShell/PowerShell
Tutorial Docs
Variables and environment
Create, read and remove variables and environment variables.
- New-VariableCreates a variable, optionally read-only.
New-Variable -Name TaxRate -Value 0.0825 -Option ReadOnly
Tutorial Docs - Set-VariableSets a variable's value.
Set-Variable -Name City -Value 'Austin'
Tutorial Docs - Get-VariableLists variables and their values.
Get-Variable -Name PS*
Tutorial Docs - Clear-VariableEmpties a variable but keeps it.
Clear-Variable -Name City
Tutorial Docs - Remove-VariableDeletes a variable.
Remove-Variable -Name City
Tutorial Docs - Get-ChildItem Env:Lists environment variables.
Get-ChildItem -Path Env: | Sort-Object -Property Name
Tutorial Docs
Users, security and scripts
Local accounts, permissions, certificates and script execution.
- Get-LocalUserLists local user accounts.
Get-LocalUser | Select-Object -Property Name, Enabled
Tutorial Docs - New-LocalUserCreates a local user account (needs admin).
New-LocalUser -Name helpdesk -NoPassword -WhatIf
Tutorial Docs - Get-LocalGroupMemberLists the members of a local group.
Get-LocalGroupMember -Group Administrators
Tutorial Docs - Get-CredentialAsks for a user name and password securely.
$cred = Get-Credential
Tutorial Docs - Get-AclShows the permissions on a file or folder.
Get-Acl -Path C:\Reports | Format-List
Tutorial Docs - Get-ExecutionPolicyShows whether scripts are allowed to run.
Get-ExecutionPolicy -List
Tutorial Docs - Set-ExecutionPolicyAllows or blocks scripts for a scope.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Tutorial Docs - New-SelfSignedCertificateCreates a self-signed certificate for testing.
New-SelfSignedCertificate -DnsName app.contoso.local -CertStoreLocation Cert:\CurrentUser\My
Tutorial Docs
Remoting and modules
Run commands on other computers and add new commands with modules.
- Enable-PSRemotingTurns on WinRM so other PCs can connect (needs admin).
Enable-PSRemoting -Force
Tutorial Docs - Invoke-CommandRuns a script block on one or more remote computers.
Invoke-Command -ComputerName PC-SALES-07 -ScriptBlock { Get-Service Spooler }Tutorial Docs - Enter-PSSessionOpens an interactive session on a remote computer.
Enter-PSSession -ComputerName PC-SALES-07
Tutorial Docs - Get-ModuleLists loaded or installed modules.
Get-Module -ListAvailable
Tutorial Docs - Install-ModuleInstalls a module from the PowerShell Gallery.
Install-Module -Name PnP.PowerShell -Scope CurrentUser
Tutorial Docs - Import-ModuleLoads a module into the session.
Import-Module -Name ActiveDirectory
Tutorial Docs
No command matches that word. Try a shorter word, or search the whole site.
Free PDF download
Keep 100 PowerShell Cmdlets in One PDF
A printable companion to this page: 100 cmdlets, each with a short explanation and an example you can run.
You’ll also get new PowerShell tutorials by email. Unsubscribe anytime.Shortcuts and translations
PowerShell Aliases and CMD Equivalents
Common aliases
Taken from Get-Alias in PowerShell 7.6 and 5.1. Run Get-Alias to see yours. More in about_Aliases.
- Get-ChildItemls, dir, gci
- Set-Locationcd, sl
- Get-Locationpwd, gl
- Get-Contentcat, gc, type
- Set-Contentsc5.1 only. In PowerShell 7, sc runs sc.exe.
- Add-Contentac
- Copy-Itemcp, copy, cpi
- Move-Itemmv, move, mi
- Remove-Itemrm, del, ri
- Rename-Itemren, rni
- New-Itemni
- Get-Itemgi
- Where-Object?, where
- ForEach-Object%, foreach
- Select-Objectselect
- Sort-Objectsort
- Group-Objectgroup
- Measure-Objectmeasure
- Compare-Objectdiff, compare
- Select-Stringsls
- Tee-Objecttee
- Format-Tableft
- Format-Listfl
- Out-GridViewogv
- Write-Outputecho, write
- Clear-Hostcls, clear
- Get-Processps, gps
- Stop-Processkill, spps
- Get-Servicegsv
- Invoke-WebRequestiwr, curl, wgetcurl and wget are 5.1 only. In PowerShell 7, curl runs curl.exe.
- Invoke-RestMethodirm
- Invoke-Commandicm
- Enter-PSSessionetsn
- Import-Moduleipmo
- Get-Commandgcm
- Get-Membergm
- Get-Aliasgal
- Get-Historyh, history
Command Prompt and Linux to PowerShell
Already know CMD or Bash? This is what to type in PowerShell instead. See PowerShell vs. Command Prompt.
| CMD | Linux | PowerShell |
|---|---|---|
| dir | ls | Get-ChildItem |
| cd | cd | Set-Location |
| copy | cp | Copy-Item |
| move | mv | Move-Item |
| del | rm | Remove-Item |
| type | cat | Get-Content |
| findstr | grep | Select-String |
| tasklist | ps | Get-Process |
| taskkill | kill | Stop-Process |
| ipconfig | ip addr | Get-NetIPAddress |
| ping | ping | Test-Connection |
| netstat | netstat / ss | Get-NetTCPConnection |
| nslookup | dig | Resolve-DnsName |
| systeminfo | uname -a | Get-ComputerInfo |
| shutdown /r | reboot | Restart-Computer |
| sc query | systemctl | Get-Service |
| cls | clear | Clear-Host |
| echo | echo | Write-Output |
PowerShell Commands: FAQs
What are PowerShell commands called?
Most are cmdlets (pronounced command-lets), named with a Verb-Noun pattern such as Get-Service. PowerShell can also run functions, aliases, scripts and regular programs like ping.exe.
How do I list all PowerShell commands?
Run Get-Command. Narrow it with -Verb, -Noun or -Module, for example Get-Command -Noun Service, or use wildcards like Get-Command *-Item.
How do I get help for a PowerShell command?
Run Get-Help followed by the command name, such as Get-Help Get-ChildItem -Examples. Add -Online to open the Microsoft Learn page, and run Update-Help once to download full help files.
Are PowerShell commands case-sensitive?
No. Get-Process, get-process and GET-PROCESS all work. Using the standard capitalization just makes scripts easier to read.
What is the difference between a cmdlet and an alias?
A cmdlet is the command itself. An alias is a short name for it, like ls for Get-ChildItem. Use aliases at the prompt, but full names in scripts.
Why do some aliases work differently in PowerShell 7?
PowerShell 7 removed a few aliases that clashed with real programs. In Windows PowerShell 5.1, curl and wget run Invoke-WebRequest and sc runs Set-Content; in PowerShell 7, curl and sc run curl.exe and sc.exe.
How many commands does PowerShell have?
It depends on the modules installed on your computer. Run (Get-Command).Count to see your total. This page covers the commands you’ll use most.
Go deeper
PowerShell Guides by Topic
Written by Bijay Kumar, a 13-time Microsoft MVP with 18+ years of hands-on experience. Every example on this page was checked against the real cmdlets in PowerShell 7 and Windows PowerShell 5.1. Found a problem? Email bijay@powershellfaqs.com.