get-service — List installed Windows services — like systemctl status across all 5 shells
Equivalents in every shell
systemctl list-units --type=serviceOn modern Linux (systemd-based: most distros since 2015), `systemctl` is canonical. `systemctl list-units --type=service --state=running` for active services; `systemctl status <name>` for a single one. Pre-systemd shows `service --status-all` (SysV-init) or `initctl list` (Upstart). On non-systemd containers, `ps` is your friend — there is no service manager.
launchctl listmacOS uses `launchd`, not systemd. `launchctl list` (per-user) and `sudo launchctl list` (system) show services with PID, exit code, and label. Service definitions live in `~/Library/LaunchAgents/` (per-user), `/Library/LaunchAgents/` (system, user-context), `/Library/LaunchDaemons/` (system, root-context). Modern macOS (12+) prefers `launchctl print system/<service>`.
systemctl list-units --type=serviceSame external `systemctl` / `launchctl` binaries. Fish has no native service abstraction.
Get-ServicePowerShell-native cmdlet. Returns `[System.ServiceProcess.ServiceController]` OBJECTS — `.Status`, `.StartType`, `.DisplayName`, `.DependentServices`, `.ServicesDependedOn`. Filter at the cmdlet level: `Get-Service -Name "wuauserv"`, `Get-Service | Where-Object Status -eq Running`. Use `-ComputerName host` (PS 5.1 only; removed in PS 6+) for remote query.
sc queryBuilt-in `sc` (service controller). `sc query` lists running services; `sc query state= all` shows everything; `sc query <name>` for one. Note the SPACE after `state=` — sc parses `key= value` not `key=value`. For richer output `sc queryex <name>` adds PID, flags, start type. `net start` (no args) lists running services in a friendlier format.
Worked examples
List all running services
systemctl list-units --type=service --state=runningsudo launchctl list | grep -v "^-"Get-Service | Where-Object Status -eq Runningnet startShow status of a specific service
systemctl status nginxGet-Service -Name w3svcsc query w3svcList services with a name pattern
systemctl list-units "ssh*" --type=serviceGet-Service -Name "Win*"Gotchas
- `Get-Service` on PowerShell 6+ removed the `-ComputerName` parameter — to query a remote box use `Invoke-Command -ComputerName host { Get-Service }`. Scripts written for Windows PowerShell 5.1 that rely on `Get-Service -ComputerName` silently degrade on cross-platform pwsh (parameter not found), even though the cmdlet itself works.
- macOS 13+ migrated user agents to the `launchctl bootstrap` / `launchctl bootout` API — old `launchctl load` / `unload` still work but emit deprecation warnings. The user-domain target is `gui/$(id -u)`, the system-domain is `system`. New scripts should spell the domain explicitly: `launchctl print gui/$(id -u)/com.example.svc`.
- systemd `systemctl status <name>` returns NON-ZERO exit code when the service is stopped (3) or failed (3) — surprising in `set -e` shell scripts. For "is it running, yes/no" checks use `systemctl is-active --quiet <name>` (exit 0 when active, non-zero otherwise) — the documented stable contract.
- `Get-Service` returns ALL services regardless of permissions, but accessing properties of services owned by SYSTEM (`.UserName`, certain registry paths) requires elevation. `Get-Service` itself works in a non-elevated session; `Set-Service` / `Start-Service` / `Stop-Service` typically need elevation. The split surprises Linux admins used to needing sudo just to read.
- cmd `sc query` truncates service display names to 80 columns and silently. For a complete picture pipe through `findstr` or just use `Get-Service` from PowerShell. The `sc` binary on Windows is unrelated to the `sc` package on some Unix distros (source-code-control); never confuse the two if scripting cross-platform.