# Run uploads for ALL entities under the Entities\ folder $scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path $entitiesDir = Join-Path $scriptRoot "Entities" if (-not (Test-Path $entitiesDir)) { Write-Host "ERROR: Entities\ folder not found." -ForegroundColor Red exit 1 } $entities = Get-ChildItem -Path $entitiesDir -Directory | Where-Object { Test-Path (Join-Path $_.FullName "entity.json") } if ($entities.Count -eq 0) { Write-Host "No entity folders with entity.json found under Entities\." -ForegroundColor Yellow exit 0 } Write-Host "Found $($entities.Count) entity/entities to process." $anyFail = $false foreach ($entity in $entities) { & powershell.exe -ExecutionPolicy Bypass -File (Join-Path $scriptRoot "engine.ps1") -EntityDir $entity.FullName if ($LASTEXITCODE -ne 0) { $anyFail = $true } } Write-Host "" if (-not $anyFail) { Write-Host "All entities complete." -ForegroundColor Green } else { Write-Host "One or more entities had failures - check output above." -ForegroundColor Yellow }