Skip to content

v2026.07.03.010: export device fields for Battlefield detail panel #8

v2026.07.03.010: export device fields for Battlefield detail panel

v2026.07.03.010: export device fields for Battlefield detail panel #8

Workflow file for this run

name: Validate ShellKnight
# Syntax gate for fleet safety: Datto RMM pulls ShellKnight.ps1 straight from
# this repo, so a parse error on main ships to every endpoint. This workflow
# blocks that failure mode - it parses the script and runs PSScriptAnalyzer
# on every push/PR that touches a .ps1 file.
on:
push:
paths: ['**.ps1', '.github/workflows/validate.yml']
pull_request:
paths: ['**.ps1', '.github/workflows/validate.yml']
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Parse check (blocks merge on syntax errors)
shell: pwsh
run: |
$tokens = $null; $errors = $null
[void][System.Management.Automation.Language.Parser]::ParseFile(
"$PWD/ShellKnight.ps1", [ref]$tokens, [ref]$errors)
if ($errors.Count -gt 0) {
foreach ($e in $errors) {
Write-Host "::error file=ShellKnight.ps1,line=$($e.Extent.StartLineNumber)::$($e.Message)"
}
throw "Parse FAILED: $($errors.Count) syntax error(s)"
}
Write-Host "Parse OK - ShellKnight.ps1 has no syntax errors"
- name: PSScriptAnalyzer (errors block, warnings inform)
shell: pwsh
run: |
Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
$results = Invoke-ScriptAnalyzer -Path ./ShellKnight.ps1 -Severity Error,Warning
$warnings = @($results | Where-Object Severity -eq 'Warning')
$errors = @($results | Where-Object Severity -eq 'Error')
foreach ($w in $warnings) {
Write-Host "::warning file=ShellKnight.ps1,line=$($w.Line)::[$($w.RuleName)] $($w.Message)"
}
foreach ($e in $errors) {
Write-Host "::error file=ShellKnight.ps1,line=$($e.Line)::[$($e.RuleName)] $($e.Message)"
}
Write-Host ""
Write-Host "PSScriptAnalyzer: $($errors.Count) error(s), $($warnings.Count) warning(s)"
if ($errors.Count -gt 0) { throw "PSScriptAnalyzer found $($errors.Count) error(s)" }