Services

Entries feed

Saturday, July 27 2019

Kill a starting service

$ServiceName = Get-Service | where { $_.Status -eq 'StartPending' } $ServicePID = (get-wmiobject win32_Service | Where { $_.Name -eq $ServiceName.Name }).ProcessID Stop-Process $ServicePID

Kill a stopping service

$ServiceName = Get-Service | where { $_.Status -eq 'StopPending' } $ServicePID = (get-wmiobject win32_Service | Where { $_.Name -eq $ServiceName.Name }).ProcessID Stop-Process $ServicePID