-
Notifications
You must be signed in to change notification settings - Fork 1
/
uninstall.ps1
31 lines (27 loc) · 1.13 KB
/
uninstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Write-Host "Searching for existing Sysmon...."
If (Get-WmiObject -Class Win32_Service -Filter "Name='Sysmon'") {
Write-Host "Uninstalling Sysmon..."
Start-Process -FilePath "Sysmon.exe" -Wait -ArgumentList "-u"
}
If (Get-WmiObject -Class Win32_Service -Filter "Name='Sysmon64'") {
Write-Host "Uninstalling Sysmon64..."
Start-Process -FilePath "Sysmon64.exe" -Wait -ArgumentList "-u"
}
Write-Host "Searching for existing Nxlog-CE..."
$app = Get-WmiObject Win32_Product -filter "Name='NXLog-CE'"
if($app) {
Write-Host "Uninstalling Nxlog-CE..."
$app.uninstall()
}
Write-Host "Searching for existing OpenEDR (aka DataFusion)..."
$app = Get-WmiObject Win32_Product -filter "Name='DataFusion'"
if($app) {
Write-Host "Uninstalling DataFusion..."
$app.uninstall()
}
Stop-Process -erroraction 'silentlycontinue' -Force -Name "uat" | Out-Null
Stop-Process -erroraction 'silentlycontinue' -Force -Name "dpfm" | Out-Null
Stop-Process -erroraction 'silentlycontinue' -Force -Name "upload" | Out-Null
schtasks /Delete /TN "UAT" /F
schtasks /Delete /TN "UATupload" /F
schtasks /Delete /TN "DFPM" /F