PowerShell Commands Cheat Sheet | Omerta One
PowerShell Commands Cheat Sheet
Curated PowerShell commands for Windows administration, security, networking, and automation — with copy‑ready blocks.
Overview
PowerShell is a task automation and configuration management framework built on .NET. This cheat sheet focuses on practical commands for system administration, security operations, networking, and automation.
System Information
Quick commands to inspect system, hardware, and OS details.
Get-ComputerInfo
systeminfo
Get-WmiObject Win32_ComputerSystem
Get-WmiObject Win32_Processor
Get-WmiObject Win32_PhysicalMemory
Get-WmiObject Win32_DiskDrive
Get-WmiObject Win32_OperatingSystem
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
Files & Directories
Navigation, creation, deletion, and movement of files and folders.
Get-ChildItem
Set-Location C:\Path
New-Item -ItemType File -Path file.txt
New-Item -ItemType Directory -Path C:\Folder
Remove-Item C:\Folder -Recurse
Copy-Item file.txt C:\Backup\
Move-Item file.txt C:\NewLocation\
Processes & Services
Inspect and control running processes and Windows services.
Get-Process
Stop-Process -Name notepad
Start-Process notepad.exe
Get-Service
Start-Service Spooler
Stop-Service Spooler
Restart-Service Spooler
Networking
Network configuration, connectivity tests, firewall rules, and listening ports.
Get-NetIPAddress
Get-NetIPConfiguration
Test-NetConnection google.com
Get-NetFirewallRule
New-NetFirewallRule -DisplayName "BlockApp" -Direction Outbound -Program "C:\app.exe" -Action Block
Get-NetTCPConnection | Where-Object {$_.State -eq "Listen"}
Security & Forensics
Event logs, hashing, and local user enumeration.
Get-EventLog -LogName Security -Newest 50
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational
Get-FileHash file.txt -Algorithm SHA256
Get-LocalUser
New-LocalUser -Name "test" -Password (Read-Host -AsSecureString)
Package Management
Modules installation and inspection.
Install-Module -Name PSReadLine
Install-Module -Name Pester
Get-InstalledModule
Automation & Scripting
Variables, loops, and functions for basic scripting.
$var = "Hello"
Write-Output $var
foreach ($i in 1..5) { Write-Output $i }
function Say-Hello {
param($name)
Write-Output "Hello $name"
}
Admin & Tasks
Elevation and scheduled tasks.
Start-Process powershell -Verb runAs
Get-ScheduledTask
Register-ScheduledTask -TaskName "Test" -Action (New-ScheduledTaskAction -Execute "notepad.exe")
Usage Notes
Many commands require elevated privileges (Run as Administrator). Use this cheat sheet as a base for DFIR workflows, system hardening, and automation scripts.
Comments
Post a Comment
Drop your thoughts below — no noise, no spam, just signal.