⚙️
System Administration
Manage processes, services, the registry, and event logs.
Processes
List running processes
Show all processes, sorted by memory use.
Get-Process | Sort-Object WorkingSet -DescendingFind a process by name
Look up a specific process.
Get-Process -Name chromeStop a process
Kill a process by name or ID.
Stop-Process -Name notepad -ForceServices
List services
Show all services and their status.
Get-Service | Where-Object Status -eq 'Running'Start or stop a service
Control a Windows service by name.
Start-Service -Name Spooler
Stop-Service -Name SpoolerRestart a service
Cycle a service off and on.
Restart-Service -Name SpoolerRegistry and environment
Read a registry value
Get a value from the Windows registry.
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductNameRead an environment variable
Access an environment variable.
$env:PATHSet an environment variable (permanent)
Persist a variable for the current user.
[Environment]::SetEnvironmentVariable("MY_VAR", "value", "User")Event logs and system info
Read recent system errors
Get the 20 most recent error events.
Get-WinEvent -LogName System -MaxEvents 20 | Where-Object LevelDisplayName -eq 'Error'Get computer info
Show OS and hardware details.
Get-ComputerInfo | Select-Object CsName, OsName, OsVersion, CsTotalPhysicalMemory