added additional services to delete

This commit is contained in:
2021-07-29 16:31:50 -04:00
parent d2a55b930c
commit 6452ed4508
+20
View File
@@ -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"""