Files
claudetools/clients/dataforth/scripts/explore-testdatadb.ps1
Mike Swanson 5cbd49ce24 Reorganize repo: compartmentalize scripts by client/project
Move 150+ scripts from root and scripts/ into client/project directories:
- clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts)
- clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination)
- clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups)
- projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto)
- projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts)
- clients/glaztech/scripts/ (1 file: CentraStage removal)

Also reorganized:
- VPN scripts → infrastructure/vpn-configs/
- Retrieved API/JS files → api/
- Forum posts → projects/community-forum/forum-posts/
- SSH docs → clients/internal-infrastructure/docs/
- NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/
- ACG website files → projects/internal/acg-website-2025/
- Dataforth docs → clients/dataforth/docs/
- schema-retrieved.sql → docs/database/

Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history).
Root reduced from 220+ files to 62 items (docs + directories only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:15:07 -07:00

54 lines
2.4 KiB
PowerShell

$password = ConvertTo-SecureString 'Paper123!@#' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential('INTRANET\sysadmin', $password)
Write-Host "[OK] Mounting AD2 C$ share..."
try {
New-PSDrive -Name AD2 -PSProvider FileSystem -Root "\\192.168.0.6\C$" -Credential $cred -ErrorAction Stop | Out-Null
Write-Host "[OK] Mounted as AD2: drive"
Write-Host "`n[OK] Exploring C:\Shares\testdatadb folder structure..."
if (Test-Path "AD2:\Shares\testdatadb") {
Write-Host "`n=== Folder Structure ==="
Get-ChildItem "AD2:\Shares\testdatadb" -Recurse -Depth 3 | Select-Object FullName, Length, LastWriteTime | Format-Table -AutoSize
Write-Host "`n=== Database Files ==="
Get-ChildItem "AD2:\Shares\testdatadb" -Recurse -Include "*.db","*.sqlite","*.json","*.sql","*.mdb","package.json","*.md","README*" | Select-Object FullName, Length
Write-Host "`n=== import.js Contents (First 100 lines) ==="
if (Test-Path "AD2:\Shares\testdatadb\database\import.js") {
Get-Content "AD2:\Shares\testdatadb\database\import.js" -TotalCount 100
} else {
Write-Host "[WARNING] import.js not found"
}
Write-Host "`n=== package.json Contents ==="
if (Test-Path "AD2:\Shares\testdatadb\database\package.json") {
Get-Content "AD2:\Shares\testdatadb\database\package.json"
} elseif (Test-Path "AD2:\Shares\testdatadb\package.json") {
Get-Content "AD2:\Shares\testdatadb\package.json"
} else {
Write-Host "[INFO] No package.json found"
}
Write-Host "`n=== README or Documentation ==="
$readmeFiles = Get-ChildItem "AD2:\Shares\testdatadb" -Recurse -Include "README*","*.md" -ErrorAction SilentlyContinue
foreach ($readme in $readmeFiles) {
Write-Host "`n--- $($readme.FullName) ---"
Get-Content $readme.FullName -TotalCount 50
}
} else {
Write-Host "[ERROR] C:\Shares\testdatadb folder not found"
Write-Host "`n[INFO] Listing C:\Shares contents..."
Get-ChildItem "AD2:\Shares" -Directory | Format-Table Name, FullName
}
} catch {
Write-Host "[ERROR] Failed to access AD2: $_"
} finally {
if (Test-Path AD2:) {
Remove-PSDrive -Name AD2 -ErrorAction SilentlyContinue
Write-Host "`n[OK] Unmounted AD2 drive"
}
}