This article will talk about the usage of PowerShell’s “Start-Service” cmdlet.
How to Use the Start-Service (Microsoft.PowerShell.Management) Cmdlet in PowerShell?
To use the “Start-Service” cmdlet, first, specify the stated cmdlet. Then, write the “-Name” parameter and assign the service to start.
Let’s overview the provided examples to learn the practical usage of the “Start-Service” cmdlet.
Example 1: Use the “Start-Service” Cmdlet to Start a Service by Name
First, use the “Start-Service” cmdlet. Then, use the “-Name” parameter and assign a service name to start:
Execute the below-stated command to verify whether the service was started or not:
Example 2: Use the “Start-Service” Cmdlet to Start a Service by Display Name
To initiate a service by its display name, first, use the parameter “-DisplayName” and provide it the display name of the service:
Example 3: Use the “Start-Service” Cmdlet to Get the Information of the Service Without Starting it
To retrieve the service information before starting it, specify the “-WhatIf” parameter along with the “Start-Service” cmdlet:
Example 4: Use the “Start-Service” Cmdlet to Start Multiple Services
First, use the “Start-Service” cmdlet. Then, write the “-Name” parameter and assign it multiple values separated by commas:
That’s it! You have learned the usage of the “Start-Service” cmdlet in PowerShell.
Conclusion
The “Start-Service” cmdlet is used to start one or more stopped services in PowerShell. This cmdlet sends the message to Windows to start a specified service. If the service is already running then the message will be overlooked without displaying an error message. This guide elaborated on the usage of the “Start-Service” cmdlet in PowerShell.