major update to override Write-Output func

This commit is contained in:
2023-10-05 13:11:38 -04:00
parent 31a06a9206
commit bbb4884818
52 changed files with 377 additions and 378 deletions
+15 -15
View File
@@ -1,21 +1,21 @@
## Remove N-Central Patch Management Service Controller
If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform\PME\unins000.exe" ) {
LogMsg "Uninstalling N-Central Patch Management Service Controller"
Write-Output "Uninstalling N-Central Patch Management Service Controller"
Try { Start-Process "${Env:ProgramFiles(x86)}\MspPlatform\PME\unins000.exe" -ArgumentList "/SILENT" -Wait }
Catch { LogErr $_.Exception.Message }
}
## Remove N-Central File Cache Service Agent
If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform\FileCacheServiceAgent\unins000.exe" ) {
LogMsg "Uninstalling N-Central File Cache Service Agent"
Write-Output "Uninstalling N-Central File Cache Service Agent"
Try { Start-Process "${Env:ProgramFiles(x86)}\MspPlatform\FileCacheServiceAgent\unins000.exe" -ArgumentList "/SILENT" -Wait }
Catch { LogErr $_.Exception.Message }
}
## Remove N-Central Request Handler Agent
If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform\RequestHandlerAgent\unins000.exe" ) {
LogMsg "Uninstalling N-Central Request Handler Agent"
Write-Output "Uninstalling N-Central Request Handler Agent"
Try { Start-Process "${Env:ProgramFiles(x86)}\MspPlatform\RequestHandlerAgent\unins000.exe" -ArgumentList "/SILENT" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -23,14 +23,14 @@ If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform\RequestHandlerAgent\unins00
## Remove Windows Software Probe
If ( Test-Path "${ProgramFiles(x86)}\N-able Technologies\Windows Software Probe\" ) {
$ProductCode = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\N-able Technologies\Windows Software Probe").ProductCode
LogMsg "Uninstalling Windows Software Probe"
Write-Output "Uninstalling Windows Software Probe"
Try { Start-Process "msiexec.exe" -ArgumentList "/X {${ProductCode}} /qn" -Wait }
Catch { LogErr $_.Exception.Message }
}
## Remove Windows Agent
If ( Test-Path "${ProgramFiles(x86)}\N-able Technologies\Windows Agent\" ) {
LogMsg "Uninstalling N-Central Windows Agent"
Write-Output "Uninstalling N-Central Windows Agent"
Try { Start-Process "msiexec.exe" -ArgumentList "/X{F5873D07-85EE-4010-A461-B60989884B1C} /qn" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -40,7 +40,7 @@ $ServiceName = "NablePatchRepositoryService"
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
If ( $Service.Length -gt 0 ) {
Control-Service -Stop -Name $ServiceName
LogMsg "Deleting the service: ""${ServiceName}"""
Write-Output "Deleting the service: ""${ServiceName}"""
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -50,7 +50,7 @@ $ServiceName = "Windows Software Probe Maintenance Service"
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
If ( $Service.Length -gt 0 ) {
Control-Service -Stop -Name $ServiceName
LogMsg "Deleting the service: ""${ServiceName}"""
Write-Output "Deleting the service: ""${ServiceName}"""
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -60,7 +60,7 @@ $ServiceName = "Windows Software Probe Syslog Service"
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
If ( $Service.Length -gt 0 ) {
Control-Service -Stop -Name $ServiceName
LogMsg "Deleting the service: ""${ServiceName}"""
Write-Output "Deleting the service: ""${ServiceName}"""
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -70,7 +70,7 @@ $ServiceName = "Windows Software Probe Service"
$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue
If ( $Service.Length -gt 0 ) {
Control-Service -Stop -Name $ServiceName
LogMsg "Deleting the service: ""${ServiceName}"""
Write-Output "Deleting the service: ""${ServiceName}"""
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -80,7 +80,7 @@ $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}"""
Write-Output "Deleting the service: ""${ServiceName}"""
Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait }
Catch { LogErr $_.Exception.Message }
}
@@ -90,33 +90,33 @@ $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}"""
Write-Output "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"""
Write-Output "Forcefully removing ""${Env:ProgramFiles(x86)}\MspPlatform"""
Try { Remove-Item "${Env:ProgramFiles(x86)}\MspPlatform" -Recurse -Force }
Catch { LogErr $_.Exception.Message }
}
## Remove "N-able Technologies" directory
If ( Test-Path "${Env:ProgramFiles(x86)}\N-able Technologies" ) {
LogMsg "Forcefully removing ""${Env:ProgramFiles(x86)}\N-able Technologies"""
Write-Output "Forcefully removing ""${Env:ProgramFiles(x86)}\N-able Technologies"""
Try { Remove-Item "${Env:ProgramFiles(x86)}\N-able Technologies" -Recurse -Force }
Catch { LogErr $_.Exception.Message }
}
## Remove "N-able Technologies" registry key
If ( Test-Path "HKLM:SOFTWARE\Wow6432Node\N-able Technologies" ) {
LogMsg "Forcefully removing ""HKLM:SOFTWARE\Wow6432Node\N-able Technologies"""
Write-Output "Forcefully removing ""HKLM:SOFTWARE\Wow6432Node\N-able Technologies"""
Try { Remove-Item "HKLM:SOFTWARE\Wow6432Node\N-able Technologies" -Recurse -Force }
Catch { LogErr $_.Exception.Message }
}
If ( Test-Path "HKLM:SOFTWARE\N-able Technologies" ) {
LogMsg "Forcefully removing ""HKLM:SOFTWARE\N-able Technologies"""
Write-Output "Forcefully removing ""HKLM:SOFTWARE\N-able Technologies"""
Try { Remove-Item "HKLM:SOFTWARE\N-able Technologies" -Recurse -Force }
Catch { LogErr $_.Exception.Message }
}