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>
64 lines
2.4 KiB
PowerShell
64 lines
2.4 KiB
PowerShell
# Test error logging by attempting a known-failing file push
|
|
$password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
|
|
$cred = New-Object System.Management.Automation.PSCredential("INTRANET\sysadmin", $password)
|
|
|
|
Write-Host "=== Testing Error Logging ===" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
|
|
Write-Host "[1] Loading sync script to test Copy-ToNAS" -ForegroundColor Yellow
|
|
|
|
# Dot-source the sync script to load functions
|
|
. "C:\Shares\test\scripts\Sync-FromNAS.ps1"
|
|
|
|
Write-Host "[2] Attempting to push a file that will fail" -ForegroundColor Yellow
|
|
Write-Host " (lowercase .dat file in HVDATA subdirectory)" -ForegroundColor Gray
|
|
Write-Host ""
|
|
|
|
# Try pushing one of the known-failing files
|
|
$testFile = "C:\Shares\test\TS-1L\ProdSW\HVDATA\hvin.dat"
|
|
|
|
if (Test-Path $testFile) {
|
|
Write-Host "[OK] Test file exists: $testFile" -ForegroundColor Green
|
|
Write-Host "[TESTING] Calling Copy-ToNAS..." -ForegroundColor Cyan
|
|
|
|
# Call Copy-ToNAS directly
|
|
$result = Copy-ToNAS -LocalPath $testFile -RemotePath "/data/test/TS-1L/ProdSW/HVDATA/hvin.dat"
|
|
|
|
Write-Host ""
|
|
if ($result) {
|
|
Write-Host "[UNEXPECTED] File pushed successfully!" -ForegroundColor Yellow
|
|
} else {
|
|
Write-Host "[EXPECTED] File push failed" -ForegroundColor Green
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "[3] Checking log for detailed error" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
|
|
$recentLog = Get-Content "C:\Shares\test\scripts\sync-from-nas.log" -Tail 5
|
|
|
|
$scpError = $recentLog | Where-Object { $_ -match "SCP PUSH ERROR" }
|
|
|
|
if ($scpError) {
|
|
Write-Host "[SUCCESS] Detailed error logged!" -ForegroundColor Green
|
|
Write-Host ""
|
|
$scpError | ForEach-Object {
|
|
Write-Host $_ -ForegroundColor Red
|
|
}
|
|
} else {
|
|
Write-Host "[FAIL] No detailed SCP error found in recent log" -ForegroundColor Red
|
|
Write-Host ""
|
|
Write-Host "Recent log entries:" -ForegroundColor Yellow
|
|
$recentLog | ForEach-Object {
|
|
Write-Host " $_" -ForegroundColor Gray
|
|
}
|
|
}
|
|
} else {
|
|
Write-Host "[ERROR] Test file not found: $testFile" -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Test Complete ===" -ForegroundColor Cyan
|