Skip to content

Instantly share code, notes, and snippets.

@fuji44
Created December 29, 2022 07:06
Show Gist options
  • Save fuji44/7798706806bf079680f8d3a93028674f to your computer and use it in GitHub Desktop.
Save fuji44/7798706806bf079680f8d3a93028674f to your computer and use it in GitHub Desktop.
Commands to manipulate services in Windows for PowerShell

Commands to manipulate services in Windows for PowerShell

Show

# Show all services
get-service

# Show service with the name "ssh-agent"
get-service "ssh-agent"

# Show services with "ssh" in the name (can use regex)
get-service | where name -match "ssh"
# The following will have the same result
get-service | where-object { $_.name -match "ssh" }

# Show services with "running" in the status
get-service | where status -eq "running"

Status control

start-service "ssh-agent"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment