Files
syncthing-android/scripts/res-string-remover.ps1
2025-07-14 00:14:54 +02:00

18 lines
533 B
PowerShell

#
while ($true) {
$stringToDelete = Read-Host "Please enter string to remove containing rows in xml files"
$basePath = ($PSScriptRoot + "\..\app\src\main\res")
#
Get-ChildItem -Path $basePath -Recurse -Filter strings.xml | ForEach-Object {
$file = $_.FullName
$lines = Get-Content $file
$filteredLines = $lines | Where-Object { $_ -notmatch [regex]::Escape($stringToDelete) }
if ($lines.Count -ne $filteredLines.Count) {
Set-Content -Path $file -Value $filteredLines
Write-Host "Processed: $file"
}
}
}
#
Exit 0