ci(lint): enhance PSScriptAnalyzer settings and suppress false positives; improve error handling in scripts

This commit is contained in:
Simone
2026-05-13 19:06:50 +02:00
committed by Simone
parent 032d6f200e
commit 2ac26dbd00
11 changed files with 42 additions and 24 deletions
+1 -1
View File
@@ -306,7 +306,7 @@ try {
try {
Invoke-RestMethod -Uri $url -Method Post -Body $body `
-ContentType 'application/json' -TimeoutSec 10
} catch { }
} catch { Write-Verbose "Webhook POST failed (non-critical): $_" }
} -ArgumentList $WebhookUrl, $warnBody
}
+1 -1
View File
@@ -117,7 +117,7 @@ for ($i = 1; $i -le $Iterations; $i++) {
Write-Host "[bench] Cloning..."
$sw = [System.Diagnostics.Stopwatch]::StartNew()
$r = Invoke-Vmrun -VmrunPath $VmrunPath -Operation clone `
$null = Invoke-Vmrun -VmrunPath $VmrunPath -Operation clone `
-Arguments @($TemplatePath, $cloneVmx, 'linked', '-snapshot', $SnapshotName) `
-ThrowOnError
$t.clone = [math]::Round($sw.Elapsed.TotalSeconds, 2)
+3 -3
View File
@@ -89,7 +89,7 @@ function Format-Elapsed {
}
}
function Run-Test {
function Invoke-Test {
param(
[string] $JobId,
[string] $Mode,
@@ -164,11 +164,11 @@ $baselineResult = $null
$guestCloneResult = $null
if (-not $SkipBaseline) {
$baselineResult = Run-Test -JobId $BaselineJobId -Mode "BASELINE (host-side zip)" -CommonParams $commonParams
$baselineResult = Invoke-Test -JobId $BaselineJobId -Mode "BASELINE (host-side zip)" -CommonParams $commonParams
}
if (-not $SkipGuestClone) {
$guestCloneResult = Run-Test -JobId $GuestCloneJobId -Mode "GUEST CLONE (-UseGitClone)" -UseGitClone -CommonParams $commonParams
$guestCloneResult = Invoke-Test -JobId $GuestCloneJobId -Mode "GUEST CLONE (-UseGitClone)" -UseGitClone -CommonParams $commonParams
}
# ────────────────────────────────────────────────────────────────────────────