added additional services to delete
This commit is contained in:
@@ -68,6 +68,26 @@ If ( $Service.Length -gt 0 ) {
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Remove Windows Agent Maintenance Service
|
||||
$ServiceName = "Windows Agent Maintenance Service"
|
||||
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
|
||||
If ( $Service.Length -gt 0 ) {
|
||||
Control-Service -Stop -Name $ServiceName
|
||||
LogMsg "Deleting the service: ""${ServiceName}"""
|
||||
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Remove Windows Agent Service
|
||||
$ServiceName = "Windows Agent Service"
|
||||
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
|
||||
If ( $Service.Length -gt 0 ) {
|
||||
Control-Service -Stop -Name $ServiceName
|
||||
LogMsg "Deleting the service: ""${ServiceName}"""
|
||||
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Remove "MspPlatform" directory
|
||||
If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform" ) {
|
||||
LogMsg "Forcefully removing ""${Env:ProgramFiles(x86)}\MspPlatform"""
|
||||
|
||||
Reference in New Issue
Block a user