@inerrata-corporation/errata 2.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/uninstall.ps1 ADDED
@@ -0,0 +1,29 @@
1
+ # errata uninstaller.
2
+ $ErrorActionPreference = "Stop"
3
+ $Target = Join-Path $env:LOCALAPPDATA "errata"
4
+
5
+ if (-not (Test-Path $Target)) {
6
+ Write-Host "errata is not installed at $Target."
7
+ exit 0
8
+ }
9
+
10
+ Write-Host "removing $Target"
11
+ Remove-Item -Path $Target -Recurse -Force
12
+
13
+ $UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
14
+ if ($UserPath) {
15
+ $PathParts = $UserPath.Split(";") | Where-Object { $_ -ne $Target }
16
+ $NewPath = ($PathParts -join ";").Trim(";")
17
+ [Environment]::SetEnvironmentVariable("Path", $NewPath, "User")
18
+ Write-Host "removed $Target from user PATH"
19
+ }
20
+
21
+ $Existing = Get-ScheduledTask -TaskName "ai.errata.daemon" -TaskPath "\errata\" -ErrorAction SilentlyContinue
22
+ if ($Existing) {
23
+ Unregister-ScheduledTask -TaskName "ai.errata.daemon" -TaskPath "\errata\" -Confirm:$false
24
+ Write-Host "removed scheduled task errata\ai.errata.daemon"
25
+ }
26
+
27
+ Write-Host ""
28
+ Write-Host "[OK] errata uninstalled."
29
+ Write-Host "Per-workspace .errata/ folders are left in place - delete them manually if desired."