Summary of commands that use PowerShell to manipulate Windows services _powershell

Source: Internet
Author: User

PowerShell offers powerful features in dealing with Windows services, and many convenient, powerful cmdlet waiting for you to patronize.

Get-service, alias GSV, gets the service object.
Example: GSV eventlog or $evtlog = GSV EventLog

Start-service, start the service.

Stop-service, stop the service.

Restart-service, restart the service.

Suspend-service, suspend/suspend service.

Resume-service, continue to serve.

Set-service, set the properties of the service.

New-service, create a new service.

Invoke the properties and methods of the service

1, first access to services
GSV < service name, or $ service variable name =GSV < service name >
2. Calling Properties
$ service Variable name. Property name
3. Calling methods
$ service Variable name. Method Name ()

There is a simpler way: (GSV < service name >) .< Property name > or < method name > (), such as (GSV w3svc). Stop ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.