-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathretry-failed.ps1
More file actions
59 lines (53 loc) · 1.99 KB
/
Copy pathretry-failed.ps1
File metadata and controls
59 lines (53 loc) · 1.99 KB
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
# Retry aller fehlgeschlagenen Ingests
$wikiRoot = $PSScriptRoot
$errors = @()
$i = 0
$relPaths = @(
'raw\slides\SFS Demand AI.pptx',
'raw\docs\Protokoll_Product_Portfolio_Weekly_2025-08-05.docx',
'raw\docs\Aufbau_Vertragsinhalte (1).docx',
'raw\pdfs\OpenAI Assistants API Guide_ Step-by-Step Tutorial _ Medium.pdf',
'raw\pdfs\BO_WEB_Handout.pdf',
'raw\pdfs\Architecting SAP Extensions with Microsoft Power Platform-1.pdf'
)
# Dateien mit Sonderzeichen im Namen per Wildcard suchen
$wildcardSearches = @(
@{ Dir = 'raw\docs'; Pattern = '*Gespr*Sales*' },
@{ Dir = 'raw\pdfs'; Pattern = '*Time Series Complexity*' },
@{ Dir = 'raw\pdfs'; Pattern = '*Umfrage*Transformation*' },
@{ Dir = 'raw\pdfs'; Pattern = '*CX25*' }
)
$allFiles = @()
foreach ($rel in $relPaths) {
$full = Join-Path $wikiRoot $rel
if (Test-Path $full) { $allFiles += $full }
else { Write-Host "Nicht gefunden: $rel" -ForegroundColor Yellow }
}
foreach ($ws in $wildcardSearches) {
$dir = Join-Path $wikiRoot $ws.Dir
$found = Get-ChildItem $dir -Filter $ws.Pattern -ErrorAction SilentlyContinue | Select-Object -First 1
if ($found) { $allFiles += $found.FullName }
else { Write-Host "Nicht gefunden: $($ws.Pattern)" -ForegroundColor Yellow }
}
$total = $allFiles.Count
Write-Host "$total Dateien zum Retry" -ForegroundColor Cyan
foreach ($full in $allFiles) {
$i++
$name = [System.IO.Path]::GetFileName($full)
Write-Host ""
Write-Host "[$i/$total] $name" -ForegroundColor Cyan
Write-Host ('=' * 60) -ForegroundColor DarkGray
Set-Location $wikiRoot
uv run "$wikiRoot\ingest.py" $full
if ($LASTEXITCODE -ne 0) {
$errors += $name
Write-Host "FEHLER" -ForegroundColor Red
}
}
Write-Host ""
Write-Host ('=' * 60)
Write-Host "Fertig: $($total - $errors.Count)/$total erfolgreich"
if ($errors.Count -gt 0) {
Write-Host "Fehlgeschlagen:" -ForegroundColor Yellow
foreach ($e in $errors) { Write-Host " - $e" -ForegroundColor Yellow }
}