Files
automations-calendar-OPEN/scripts/refresh_automations_calendar.ps1
T

20 lines
1.2 KiB
PowerShell
Raw Normal View History

2026-09-22 07:50:20 -06:00
[CmdletBinding()]
param(
[Parameter(Mandatory)][string]$Workbook,
[string]$Status = (Join-Path $PSScriptRoot '../examples/status.example.json'),
[string]$OutputDirectory = (Join-Path $PSScriptRoot '../output'),
[string]$Python = 'python'
)
$ErrorActionPreference = 'Stop'
# Offline rendering only. Collect real evidence separately with explicit source flags.
$pythonCommand = Get-Command $Python -ErrorAction Stop
$Html = Join-Path $OutputDirectory 'automations-calendar.html'
$Results = Join-Path $OutputDirectory 'automations-results.html'
& $pythonCommand.Source (Join-Path $PSScriptRoot 'build_automations_calendar.py') --workbook $Workbook --html $Html --status $Status
if ($LASTEXITCODE -ne 0) { throw "Calendar generation failed: $LASTEXITCODE" }
& $pythonCommand.Source (Join-Path $PSScriptRoot 'build_automation_results.py') --workbook $Workbook --status $Status --output $Results
if ($LASTEXITCODE -ne 0) { throw "Results generation failed: $LASTEXITCODE" }
foreach ($path in @($Html, $Results)) {
if (-not (Test-Path -LiteralPath $path) -or (Get-Item -LiteralPath $path).Length -eq 0) { throw "Missing or empty dashboard: $path" }
}
Write-Output 'Verified calendar and results dashboard outputs.'