-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUninstaller.ps1
More file actions
30 lines (26 loc) · 865 Bytes
/
Copy pathUninstaller.ps1
File metadata and controls
30 lines (26 loc) · 865 Bytes
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
#region Preparation
$ErrorActionPreference = 'Stop'
$ccsFolder = "$env:LOCALAPPDATA\CCS"
$functionsModule = "$ccsFolder\Functions.psm1"
$listenerTask = 'CCS Listener'
#endregion Preparation
#region Scheduled Task
Stop-ScheduledTask -TaskName $listenerTask -ErrorAction 'SilentlyContinue'
Unregister-ScheduledTask -TaskName $listenerTask -Confirm $false -ErrorAction 'SilentlyContinue'
#endregion Scheduled Task
#region Check Installation
if (-not (Test-Path -Path $ccsFolder -PathType 'Container')) {
Clear-Host
Write-Warning -Message "Can't find CCS files!"
Pause
exit
}
#endregion Check Installation
#region Restore Cursor
Import-Module -Name $functionsModule -Force
Reset-Cursor
#endregion Restore Cursor
#region Cleanup
Remove-Module -Name 'Functions' -Force
Remove-Item -Path $ccsFolder -Recurse -Force
#endregion Cleanup