How do I uninstall a Windows service using a PowerShell script?

16

4

I want to find and uninstall a Windows service.

How can I accomplish this using a PowerShell script?

sarat

Posted 2012-05-25T06:03:39.487

Reputation: 1 356

Answers

24

(Get-WmiObject Win32_Service -filter "name='<service_name>'").Delete()

For more information:
Get-WmiObject
Delete method of the Win32_Service class

Indrek

Posted 2012-05-25T06:03:39.487

Reputation: 21 756