PowerShell Essentials: Common Cmdlets
with Examples
Introduction
Here’s a curated list of the most commonly used PowerShell commands with examples,
ideal for building a course or cheat sheet. These cover system management, file operations,
networking, security, and scripting fundamentals.
Core PowerShell Cmdlets
1. Get-Help
Displays help info for any cmdlet.
Example:
Get-Help Get-Process
2. Get-Command
Lists all available cmdlets, functions, and scripts.
Example:
Get-Command
3. Get-Process
Shows running processes.
Example:
Get-Process | Sort-Object CPU -Descending
4. Get-Service
Lists services and their status.
Example:
Get-Service | Where-Object $ .Status -eq "Running"
5. Get-EventLog / Get-WinEvent
Reads Windows event logs.
Example:
Get-EventLog -LogName Security -Newest 10
1
6. Get-Content
Reads file contents.
Example:
Get-Content -Path "C:
Logs
[Link]"
7. Set-ExecutionPolicy
Controls script execution permissions.
Example:
Set-ExecutionPolicy RemoteSigned
8. Test-Connection
Sends ICMP ping to test host reachability.
Example:
Test-Connection -ComputerName [Link] -Count 2
9. Invoke-WebRequest
Downloads data from the web.
Example:
Invoke-WebRequest -Uri "[Link] -OutFile
"[Link]"
File Operations
10. Get-ChildItem
Lists files and folders (like dir).
Example:
Get-ChildItem -Path "C:
Users" -Recurse
2
11. Copy-Item
Copies files or folders.
Example:
Copy-Item -Path "C:
[Link]" -Destination "D:
backup
"
12. Move-Item
Moves files or folders.
Example:
Move-Item -Path "C:
[Link]" -Destination "D:
archive
"
13. Remove-Item
Deletes files or folders.
Example:
Remove-Item -Path "C:
[Link]"
14. New-Item
Creates a new file or folder.
Example:
New-Item -Path "C:
newfolder" -ItemType Directory
System Network Management
15. Get-WmiObject / Get-CimInstance
Queries system info (hardware/software).
Example:
Get-WmiObject -Class Win32 OperatingSystem
3
16. Get-NetTCPConnection
Lists active TCP connections.
Example:
Get-NetTCPConnection | Where-Object $ .State -eq "Established"
17. Start-Process
Launches an application.
Example:
Start-Process "[Link]"
18. Stop-Process
Terminates a process.
Example:
Stop-Process -Name "notepad"
Scripting Fundamentals
19. Where-Object
Filters objects based on conditions.
Example:
Get-Process | Where-Object $ .CPU -gt 100
20. ForEach-Object
Loops through each item in a pipeline.
Example:
Get-Service | ForEach-Object { "$(.Name) is $(.Status)" }
Summary
These 20 cmdlets form the foundation of PowerShell scripting and administration. Mas-
ter these commands to efficiently manage Windows systems, automate tasks, and write
powerful scripts. Practice combining them with pipes (—) for advanced filtering and data
manipulation.