Files
claudetools/clients/dataforth/scripts/convert-to-dos.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

42 lines
1.3 KiB
PowerShell

# Convert all batch files to DOS format (CRLF) automatically
Write-Host "=== Converting Batch Files to DOS Format ===" -ForegroundColor Cyan
Write-Host ""
# Find all .bat files (excluding git/node_modules)
$batFiles = Get-ChildItem -Recurse -Filter "*.bat" | Where-Object {
$_.FullName -notlike "*\.git\*" -and
$_.FullName -notlike "*\node_modules\*"
}
Write-Host "Converting $($batFiles.Count) batch files..." -ForegroundColor Yellow
Write-Host ""
$converted = 0
$errors = 0
foreach ($file in $batFiles) {
try {
# Read file content
$content = Get-Content $file.FullName -Raw
# Normalize to DOS line endings (CRLF)
$dosContent = $content -replace "`r?`n", "`r`n"
# Write back with ASCII encoding (DOS compatible)
[System.IO.File]::WriteAllText($file.FullName, $dosContent, [System.Text.Encoding]::ASCII)
Write-Host "[OK] $($file.Name)" -ForegroundColor Green
$converted++
} catch {
Write-Host "[ERROR] $($file.Name): $($_.Exception.Message)" -ForegroundColor Red
$errors++
}
}
Write-Host ""
Write-Host "=== Conversion Complete ===" -ForegroundColor Green
Write-Host "Converted: $converted files" -ForegroundColor Green
if ($errors -gt 0) {
Write-Host "Errors: $errors files" -ForegroundColor Red
}