100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Processes and Services

Learn how to inspect, start, stop, and control Windows processes and services using PowerShell's process and service management cmdlets.

AutomationIntermediate9 min readJul 10, 2026
Analogies

Inspecting Running Processes

Get-Process returns every running process as an object with properties like Id, ProcessName, CPU, and WorkingSet, so you can pipe it into Sort-Object CPU -Descending to find the heaviest consumers or Where-Object { $_.WorkingSet -gt 500MB } to isolate memory-hungry processes. Get-Process -Name notepad or Get-Process -Id 1234 lets you target a specific process by name or process ID, and the returned object exposes a Modules collection and a StartTime property useful for diagnostics.

🏏

Cricket analogy: Sorting Get-Process by CPU -Descending is like ranking a tournament's batsmen by strike rate, immediately surfacing whoever is consuming the most 'resources' (deliveries faced) fastest.

Starting and Stopping Processes

Start-Process launches an executable and supports -ArgumentList for command-line arguments, -WindowStyle to control visibility, -Verb RunAs to elevate with UAC, and -Wait to block the script until the launched process exits. Stop-Process -Id or -Name terminates a running process, and -Force is required to kill a process that would otherwise prompt for confirmation or resist termination, though forcibly killing a process skips its normal cleanup and can leave file handles or temp files behind.

🏏

Cricket analogy: Start-Process -Wait is like a captain waiting for the current over to finish before making a bowling change, blocking further action until the process (over) completes.

Managing Windows Services

Get-Service lists Windows services with a Status property of Running, Stopped, or others, and Start-Service, Stop-Service, and Restart-Service control a service's running state by name, such as Restart-Service -Name Spooler. Set-Service -StartupType controls whether a service starts Automatic, Manual, or Disabled at boot, and because many services depend on others, Stop-Service will fail on a service with running dependents unless you add -Force, which stops dependent services too.

🏏

Cricket analogy: Set-Service -StartupType Automatic is like a franchise permanently including a player in the starting XI for every match, versus Manual, which is like calling them up only when specifically needed.

powershell
# Find the top 5 CPU-consuming processes
Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 Name, Id, CPU, WorkingSet

# Restart a service and confirm it's running, forcing dependents to restart too
Stop-Service -Name Spooler -Force
Start-Service -Name Spooler
Get-Service -Name Spooler | Select-Object Name, Status, StartType

# Launch an elevated process and wait for it to finish
Start-Process -FilePath 'diskpart.exe' -Verb RunAs -Wait

Get-CimInstance -ClassName Win32_Process exposes information Get-Process does not, such as the parent process ID (ParentProcessId) and the full command line used to start a process, which is invaluable when auditing what launched a suspicious process.

  • Get-Process returns process objects with properties like Id, CPU, and WorkingSet that can be sorted and filtered.
  • Start-Process supports -ArgumentList, -Verb RunAs for elevation, and -Wait to block until the process exits.
  • Stop-Process -Force terminates a process immediately, skipping normal cleanup.
  • Get-Service lists services with a Status of Running, Stopped, and others.
  • Start-Service, Stop-Service, and Restart-Service control a service's runtime state by name.
  • Set-Service -StartupType controls whether a service starts Automatic, Manual, or Disabled.
  • Stop-Service -Force is required to stop a service that has running dependent services.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#PowerShellStudyNotes#ProcessesAndServices#Processes#Services#Inspecting#Running#StudyNotes#SkillVeris#ExamPrep