-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUninstall.ps1
More file actions
23 lines (17 loc) · 1.08 KB
/
Copy pathUninstall.ps1
File metadata and controls
23 lines (17 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# OutlookExportMarkdown — Uninstall Script
$progId = "OutlookExportMarkdown"
$installDir = "$env:APPDATA\OutlookExportMarkdown"
Write-Host "Uninstalling OutlookExportMarkdown..." -ForegroundColor Cyan
# Remove registry add-in entry
$regPath = "HKCU:\SOFTWARE\Microsoft\Office\Outlook\Addins\$progId"
if (Test-Path $regPath) { Remove-Item $regPath -Force; Write-Host "Registry entry removed" -ForegroundColor Green }
# Remove VSTO trust entry
$vstoUrl = "file:///$($installDir.Replace('\','/'))/OutlookExportMarkdown.vsto"
$trustRoot = "HKCU:\SOFTWARE\Microsoft\VSTO\Security\Inclusion"
Get-ChildItem $trustRoot -ErrorAction SilentlyContinue |
Where-Object { (Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue).Url -eq $vstoUrl } |
ForEach-Object { Remove-Item $_.PSPath -Force; Write-Host "VSTO trust entry removed" -ForegroundColor Green }
# Remove install folder
if (Test-Path $installDir) { Remove-Item $installDir -Recurse -Force; Write-Host "Files removed" -ForegroundColor Green }
Write-Host ""
Write-Host "Uninstall complete. Restart Outlook." -ForegroundColor Green