Skip to content

Commit 8a48073

Browse files
committed
Add Remove-SignalFiles script and scripts readme
1 parent ce75302 commit 8a48073

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

scripts/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Scripts
2+
3+
## Remove-SignalFiles
4+
5+
Deletes all database, log, and attachment files in LocalCache.

scripts/Remove-SignalFiles.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
function Remove-SignalFiles {
2+
[CmdletBinding(
3+
SupportsShouldProcess,
4+
ConfirmImpact = "High"
5+
)]
6+
param (
7+
[Switch]$Force
8+
)
9+
10+
if ($Force -and -not $Confirm) {
11+
$ConfirmPreference = "None"
12+
}
13+
14+
$localCachePath = "$env:LOCALAPPDATA/Packages/2383BenediktRadtke.SignalPrivateMessenger_teak1p7hcx9ga/LocalCache"
15+
if ($PSCmdlet.ShouldProcess($localCachePath, "Delete databases, logs, and attachments")) {
16+
Remove-Item -Recurse -Force "$localCachePath/*"
17+
Write-Host "Removed items"
18+
}
19+
}
20+
21+
Remove-SignalFiles

0 commit comments

Comments
 (0)