Start-Service

Start one or more stopped services.

Syntax
      Start-Service { [-name] string[]
                    | [-displayName] string[]
                    | [-inputObject ServiceController[]] }
                         [-include string[]] [-exclude string[]]
                            [-passthru] [-whatIf]
                               [-confirm] [CommonParameters]

Key
   -name string
       The service names to be started.

   -displayName string
       The display names to be started, wildcards are permitted.

   -inputObject ServiceController
       Start the services represented by ServiceController.
       Enter a command, expression or variable that contains the objects.

   -include string
       Start only the specified services. Qualifies the -Name parameter.
       Wildcards , such as "s*" are permitted.

   -exclude string
       Omit the specified services e.g. "*SS64*"
       Qualifies the -Name parameter, Wildcards are permitted.

   -passThru 
       Pass the object created by Start-Service along the pipeline. 

   -whatIf
       Describe what would happen if you executed the command without
       actually executing the command.

   -confirm
       Prompt for confirmation before executing the command.

Standard Aliases for Start-Service: sasv

If a service is already running, the start message is ignored without error.
-ServiceName is an alias for -Name.

If a service has its Start_Type set to Disabled then you must use Set-Service to change the Startup to Manual (or Automatic) before you will be able to start the service.

Examples

Use the -whatif parameter to show what would happen if the 'Themes' service were to be started:

PS C:\> Start-Service -name Themes -whatif

Start the Themes service and log the result to a file:

PS C:\> Start-Service -name Themes -passthru | Format-List >> startup_log.txt

“Success is a state of mind. If you want success, start thinking of yourself as a success” ~ Dr. Joyce Brothers

Related PowerShell Cmdlets

Get-Service - Get a list of services.
New-Service - Create a new service.
Restart-Service
- Restart a stopped service.
Resume-Service
- Resume a suspended service.
Set-Service
- Make and set changes to the properties of a service.
Stop-Service
- Stop a running service.
Suspend-Service
- Suspend a running service.
Get-CIMInstance Win32_Service -Filter "name = 'ServiceName'"
Windows cmd command: NET START / SC - Service Control.


 
Copyright © 1999-2024 SS64.com
Some rights reserved