Start-Service

Get the access control list for a file or object.

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 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*"
       this only works when the path includes a wildcard character.

   -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.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

If a service is already running, the start message is ignored without error.

If a service has it's 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 Commands:

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

Windows cmd commands: NET START / SC - Service Control



Back to the Top

© Copyright SS64.com 1999-2010
Some rights reserved