# Test script to debug user registry detection Write-Host "=== User Registry Detection Test ===" -ForegroundColor Cyan # 1. Check HKU (HKEY_USERS) for all loaded user hives Write-Host "`n[1] Checking loaded user hives in HKU:" -ForegroundColor Yellow $hkuKeys = Get-ChildItem "Registry::HKU" -ErrorAction SilentlyContinue foreach ($key in $hkuKeys) { $sid = $key.PSChildName if ($sid -match "^S-1-5-21-" -and $sid -notmatch "_Classes$") { Write-Host " SID: $sid" -ForegroundColor Gray $uninstallPath = "Registry::HKU\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" if (Test-Path $uninstallPath) { $apps = Get-ItemProperty $uninstallPath -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "*Dashboard*" -or $_.DisplayName -like "*GE Aerospace*" } if ($apps) { foreach ($app in $apps) { Write-Host " FOUND: $($app.DisplayName)" -ForegroundColor Green } } else { Write-Host " No Dashboard/GE Aerospace apps" -ForegroundColor Gray } } } } # 2. Check HKCU directly Write-Host "`n[2] Checking HKCU (current user):" -ForegroundColor Yellow $hkcuApps = Get-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "*Dashboard*" -or $_.DisplayName -like "*GE Aerospace*" } if ($hkcuApps) { foreach ($app in $hkcuApps) { Write-Host " FOUND: $($app.DisplayName)" -ForegroundColor Green } } else { Write-Host " No Dashboard/GE Aerospace apps in HKCU" -ForegroundColor Gray } # 3. Check user profiles Write-Host "`n[3] User profiles in C:\Users:" -ForegroundColor Yellow $profiles = Get-ChildItem "C:\Users" -Directory | Where-Object { $_.Name -notin @('Public','Default','Default User','All Users') } foreach ($p in $profiles) { Write-Host " $($p.Name)" -ForegroundColor Gray } # 4. Current user context Write-Host "`n[4] Current execution context:" -ForegroundColor Yellow Write-Host " Username: $env:USERNAME" -ForegroundColor Gray Write-Host " UserDomain: $env:USERDOMAIN" -ForegroundColor Gray Write-Host "`n=== Done ===" -ForegroundColor Cyan