-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall-win.ps1
executable file
·77 lines (60 loc) · 2.26 KB
/
uninstall-win.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
function Remove-IPFSScheduledTask {
Write-Host "Removing IPFS scheduled task..."
$ipfsTaskName = "IPFS Daemon"
if (Get-ScheduledTask -TaskName $ipfsTaskName -ErrorAction SilentlyContinue) {
Unregister-ScheduledTask -TaskName $ipfsTaskName -Confirm:$false
Write-Host "IPFS scheduled task removed."
} else {
Write-Host "IPFS scheduled task not found."
}
}
function Remove-IPFSClusterFollowScheduledTask {
Write-Host "Removing IPFS Cluster Follow scheduled task..."
$ipfsClusterTaskName = "IPFS Cluster Follow"
if (Get-ScheduledTask -TaskName $ipfsClusterTaskName -ErrorAction SilentlyContinue) {
Unregister-ScheduledTask -TaskName $ipfsClusterTaskName -Confirm:$false
Write-Host "IPFS Cluster Follow scheduled task removed."
} else {
Write-Host "IPFS Cluster Follow scheduled task not found."
}
}
function Uninstall-IPFS {
Write-Host "Uninstalling IPFS..."
$ipfsPath = "$env:LOCALAPPDATA\go-ipfs"
if (Test-Path $ipfsExePath) {
Remove-Item -Recurse -Force $ipfsPath
Write-Host "IPFS uninstalled."
} else {
Write-Host "IPFS not found."
}
$ipfsSettingsPath = "$env:USERPROFILE\.ipfs"
if (Test-Path $ipfsSettingsPath) {
Remove-Item -Recurse -Force $ipfsSettingsPath
Write-Host "IPFS Settings removed."
} else {
Write-Host "IPFS Settings not found."
}
}
function Uninstall-IPFSClusterFollow {
Write-Host "Uninstalling IPFS Cluster Follow..."
$ipfsClusterFollowExePath = "$env:LOCALAPPDATA\ipfs-cluster-follow\ipfs-cluster-follow.exe"
$ipfsClusterFollowPath = "$env:LOCALAPPDATA\ipfs-cluster-follow"
if (Test-Path $ipfsClusterFollowPath) {
Remove-Item -Recurse -Force $ipfsClusterFollowPath
Write-Host "IPFS Cluster Follow uninstalled."
} else {
Write-Host "IPFS Cluster Follow not found."
}
$ipfsClusterFollowSettingsPath = "$env:USERPROFILE\.ipfs-cluster-follow"
if (Test-Path $ipfsClusterFollowSettingsPath) {
Remove-Item -Recurse -Force $ipfsClusterFollowSettingsPath
Write-Host "IPFS Cluster Follow Settings removed."
} else {
Write-Host "IPFS Cluster Follow Settings not found."
}
}
Remove-IPFSClusterFollowScheduledTask
Uninstall-IPFSClusterFollow
Remove-IPFSScheduledTask
Uninstall-IPFS
Write-Host "IPFS and IPFS Cluster Follow have been uninstalled successfully."