-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-curated.ps1
More file actions
60 lines (49 loc) · 2.08 KB
/
Copy pathdebug-curated.ps1
File metadata and controls
60 lines (49 loc) · 2.08 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
# Debug script to check curated bookmarks loading
$scriptDir = Split-Path -Parent $PSScriptRoot
$bookmarksDir = Join-Path $scriptDir 'bookmarks'
# Load banned-links.psd1
$bannedLinksPath = Join-Path $bookmarksDir 'banned-links.psd1'
Write-Host "Loading: $bannedLinksPath" -ForegroundColor Cyan
try {
$data = Import-PowerShellDataFile $bannedLinksPath
Write-Host "SUCCESS! Top-level keys: $($data.Keys -join ', ')" -ForegroundColor Green
if ($data.ContainsKey('OSINT')) {
Write-Host "`nOSINT structure:" -ForegroundColor Yellow
Write-Host " Type: $($data.OSINT.GetType().Name)"
Write-Host " Keys: $($data.OSINT.Keys -join ', ')"
foreach ($key in $data.OSINT.Keys) {
$value = $data.OSINT[$key]
Write-Host "`n $key :" -ForegroundColor Cyan
Write-Host " Type: $($value.GetType().Name)"
if ($value -is [hashtable]) {
Write-Host " Keys: $($value.Keys -join ', ')"
} elseif ($value -is [array]) {
Write-Host " Count: $($value.Count)"
}
}
}
} catch {
Write-Host "ERROR: $($_.Exception.Message)" -ForegroundColor Red
}
# Now simulate what bookmarks.ps1 does
Write-Host "`n=== Simulating bookmarks.ps1 merge ===" -ForegroundColor Magenta
$CuratedBookmarks = @{}
# Simulate loading with MergePath = ''
$dataToMerge = $data
$mergeTarget = $CuratedBookmarks
foreach ($key in $dataToMerge.Keys) {
if ($mergeTarget.ContainsKey($key)) {
Write-Host "Merging into existing key: $key"
} else {
$mergeTarget[$key] = $dataToMerge[$key]
Write-Host "Added new key: $key"
}
}
Write-Host "`nCuratedBookmarks keys: $($CuratedBookmarks.Keys -join ', ')" -ForegroundColor Green
if ($CuratedBookmarks.ContainsKey('OSINT')) {
Write-Host "OSINT is present in CuratedBookmarks!" -ForegroundColor Green
Write-Host "OSINT type: $($CuratedBookmarks.OSINT.GetType().Name)"
Write-Host "OSINT keys: $($CuratedBookmarks.OSINT.Keys -join ', ')"
} else {
Write-Host "OSINT is NOT in CuratedBookmarks!" -ForegroundColor Red
}