-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-unseen.ps1
More file actions
30 lines (25 loc) · 1 KB
/
Copy pathcheck-unseen.ps1
File metadata and controls
30 lines (25 loc) · 1 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
# Zeigt Dateien in raw/ die noch nicht ingested wurden
$rawPath = Join-Path $PSScriptRoot "raw"
$seenFile = Join-Path $PSScriptRoot "logs\seen-files.txt"
$extensions = @('.pptx','.docx','.pdf','.md')
$allFiles = Get-ChildItem -Path $rawPath -Recurse -File -ErrorAction SilentlyContinue |
Where-Object {
$extensions -contains $_.Extension.ToLower() -and
$_.FullName -notlike '*\.cache\*' -and
$_.Name -notmatch '^\~\$'
}
$seen = @{}
if (Test-Path $seenFile) {
Get-Content $seenFile -Encoding UTF8 | ForEach-Object {
if ($_.Trim()) { $seen[$_.Trim()] = 1 }
}
}
$new = $allFiles | Where-Object { -not $seen.ContainsKey($_.FullName) }
Write-Host "Dateien in raw/: $($allFiles.Count)"
Write-Host "In seen-files.txt: $($seen.Count)"
Write-Host "Noch nicht ingested: $($new.Count)"
if ($new.Count -gt 0) {
Write-Host ""
Write-Host "Nicht ingested:" -ForegroundColor Yellow
$new | ForEach-Object { Write-Host " $($_.Name)" -ForegroundColor Cyan }
}