CmdID

CmdID / PowerShell / Cmdlets / Start

Start-Service

Starts one or more stopped services. PowerShell reference

From the PowerShell reference 8 parameters Alias sasv

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Starts one or more stopped services. The Start-Service cmdlet sends a start message to the Windows Service Controller for each of the specified services. If a service is already running, the message is ignored without error. You can specify the services by their service names or display names, or you can use the InputObject parameter to supply a service object that represents the services that you want to start.

Start-Service [-InputObject] <ServiceController[]> [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Start-Service [-Name] <String[]> [-PassThru] [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Start-Service [-PassThru] -DisplayName <String[]> [-Include <String[]>] [-Exclude <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Start a service by using its name

Start-Service -Name "eventlog"Identify

Display information without starting a service

Start-Service -DisplayName remote -WhatIfIdentify

Start a service and record the action in a text file

$s = Get-Service wmi Start-Service -InputObject $s -PassThru | Format-List >> services.txtIdentify

Start a disabled service

PS> Start-Service tlntsvr Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot start service TlntSvr on computer '.'. At line:1 char:14 + Start-Service <<<< tlntsvr PS> Get-CimInstance Win32_Service | Where-Object Name -EQ "tlntsvr" ExitCode : 0 Name : TlntSvr ProcessId : 0 StartMode : Disabled State : Stopped Status : OK PS> Set-Service tlntsvr -StartupType manual PS> Start-Service tlntsvrIdentify

Its page in the reference: Start-Service.

Parameters

8 in the PowerShell reference
-DisplayNameSpecifies the display names of the services to start. Wildcard characters are permitted.
-ExcludeSpecifies services that this cmdlet omits. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as s*. Wildcard characters are permitted.
-IncludeSpecifies services that this cmdlet starts. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as s*. Wildcard characters are permitted.
-InputObjectSpecifies ServiceController objects representing the services to be started. Enter a variable that contains the objects, or type a command or expression that gets the objects.
-NameSpecifies the service names for the service to be started. The parameter name is optional. You can use Name or its alias, ServiceName, or you can omit the parameter name.
-PassThruReturns an object that represents the service. By default, this cmdlet does not generate any output.
-ConfirmPrompts you for confirmation before running the cmdlet.
-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.