PowerShell is Microsoft's powerful command-line shell and scripting language, built for system administration. It combines the flexibility of shells like Bash with the power of .NET, letting you automate complex tasks with just a few commands.
PowerShell is especially useful for:
PowerShell uses cmdlets — small, specialized commands in Verb-Noun format, e.g. Get-Process.
Chain commands with | to pass the output of one cmdlet as input to the next.
Get-Process | Where-Object {$_.CPU -gt 100}
Unlike traditional shells, PowerShell works with .NET objects instead of plain text — making data processing much more robust.
Variables start with $, e.g. $name = "Benjamin".
Use Enter-PSSession or Invoke-Command to run commands on remote machines.
| Command | Description |
|---|---|
| Get-Help | Show help for cmdlets |
| Get-Command | List available cmdlets |
| Get-Process | Show running processes |
| Stop-Process | Kill a process |
| Get-Service | List services |
| Start-Service | Start a service |
| Stop-Service | Stop a service |
| Set-Service | Configure a service |
| Get-EventLog | Read event logs |
| Get-Content | Read file contents |
| Set-Content | Write to a file |
| Add-Content | Append content to a file |
| Copy-Item | Copy files/folders |
| Move-Item | Move files/folders |
| Remove-Item | Delete files/folders |
| Get-ChildItem | List files/folders |
| Test-Path | Check if a path exists |
| New-Item | Create a file or folder |
| Get-Variable | List variables |
| Clear-Host | Clear the console |
Get-Process | Where-Object {$_.CPU -gt 200} | Stop-Process
PowerShell is an essential tool for admins, DevOps engineers, and power users. These basics give you a solid foundation to work productively and automate your environment.
H@ppy H@cking