Removes a hypothetical service using WMI.

PowerShell
Edit|Remove
# -----------------------------------------------------------------------------
# Remove-Service.ps1
# ed wilson, msft, 7/7/2010
# 
# removes a hypothetical service using WMI
# -----------------------------------------------------------------------------

$Computer = "."
$serviceName = "myService"
$query = "Select * from Win32_Service where name = '$serviceName'"
$rtn = Get-WmiObject -Query $query -ComputerName $computer
$rtn.stopService()
$rtn.Delete()