$ErrorActionPreference = 'Stop'
$file = & powershell -NoProfile -ExecutionPolicy Bypass -File .\log_audit_viewer.ps1 -Dashboard
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$target = ($file | Select-Object -Last 1).Trim()
if ($target -and (Test-Path $target)) {
  Start-Process $target
  Write-Output "Dashboard dibuka: $target"
} else {
  throw 'Dashboard tidak berhasil dibuat.'
}
