This commit is contained in:
2026-01-31 22:10:45 -05:00
parent 6d26cbbb35
commit 39962ec491

View File

@@ -139,12 +139,21 @@ $chunks = @(
foreach ($c in $chunks) { foreach ($c in $chunks) {
$content = Import-SamyChunk -Url $c.Url -Name $c.Name try {
. ([ScriptBlock]::Create($content)) $content = Import-SamyChunk -Url $c.Url -Name $c.Name -ErrorAction Stop
Write-Host "[Success] Loaded: $($c.Name)" -ForegroundColor Green . ([ScriptBlock]::Create($content))
Write-Host "[Success] $($c.Name)" -ForegroundColor Green
}
catch {
$msg = $_.Exception.Message
if ([string]::IsNullOrWhiteSpace($msg)) { $msg = "$_" }
Write-Host "[Failed] $($c.Name): $msg" -ForegroundColor Red
throw # or continue
}
} }
if (-not (Get-Command Invoke-ScriptAutomationMonkey -ErrorAction SilentlyContinue)) { if (-not (Get-Command Invoke-ScriptAutomationMonkey -ErrorAction SilentlyContinue)) {
throw "Bootstrap loaded chunks, but Invoke-ScriptAutomationMonkey was not found. Ensure src/core.ps1 defines it." throw "Bootstrap loaded chunks, but Invoke-ScriptAutomationMonkey was not found. Ensure src/core.ps1 defines it."
} }