JcHub
Cheat sheetFree, no sign-upPDF

PowerShell & CMD Cheat Sheet: Essential Windows Commands

A concise reference guide of essential Windows CLI commands to manage your system, troubleshoot networks, and automate workflows.

Updated on November 6, 2026

Navigation and File Management

  • cd C:\Users\ProjectChanges directory. In CMD, use cd /d D:\ to switch drives, while PowerShell handles drive switching directly.
  • Get-ChildItem -HiddenLists hidden files in folder via PowerShell. In CMD, use dir /a to show all system and hidden files.
  • Remove-Item -Recurse -Force .\folderDeletes a folder and contents in PowerShell. Warning: Force flag suppresses all confirmation prompts.
  • robocopy C:\source D:\backup /MIRMirrors folder structure. Useful for backups, but /MIR deletes files in destination that no longer exist in source.

Networking and Diagnostics

  • Test-NetConnection -ComputerName jchub.dev -Port 443Checks if a remote port is open in PowerShell. Replaces telnet, which is disabled by default on Windows.
  • ipconfig /flushdnsFlushes DNS resolver cache in CMD and PowerShell. Essential for resolving domain update propagation issues.
  • Get-NetIPAddress -AddressFamily IPv4Displays local IPv4 addresses in PowerShell. More precise than ipconfig for scripting server automation.
  • netstat -anoLists active connections and listening ports with PIDs. Useful for finding which application blocks a local port.

Process Management

  • Get-Process nodeDisplays Node.js process details in PowerShell. Returns an error if no matching process is currently running.
  • Stop-Process -Name "node" -ForceForces termination of all Node.js processes in PowerShell. Instantly stops them without saving pending state.
  • tasklist /FI "STATUS eq RUNNING"Lists active running tasks in CMD. Filter expressions require double quotes and exact property names.
  • taskkill /F /PID 1234Kills process with PID 1234 in CMD and PowerShell. The /F flag is required to forcefully end unresponsive apps.

Search and Filtering

  • Select-String -Path "*.log" -Pattern "ERROR"Searches for ERROR in log files via PowerShell. Equivalent to grep on Linux for log troubleshooting.
  • findstr /I /C:"error" app.logSearches text in CMD ignoring case (/I). The /C flag forces literal matching for multi-word phrases.
  • Get-Service -Status RunningDirectly filters active running Windows services in PowerShell without requiring pipeline processing.
  • where nodeLocates the executable path for Node in CMD and PowerShell. Shows which binary path is currently priority.

Security and Administration

  • Set-ExecutionPolicy RemoteSigned -Scope CurrentUserAllows execution of local PowerShell scripts. Note: without CurrentUser scope, admin rights are required.
  • Get-FileHash .\app.zip -Algorithm SHA256Calculates SHA256 checksum of a file in PowerShell. Useful for verifying file integrity after downloads.
  • sfc /scannowScans and repairs corrupted Windows system files. Requires running command prompt with Administrator privileges.
  • Get-HistoryDisplays command history for current PowerShell session. Resets completely once terminal window is closed.

Other resources

Need help with your website?

I build your custom website.

Showcase site, online shop, management tool: let’s talk about your project.

See the services