param( [Parameter(Mandatory = $true)] [string]$Path ) $ErrorActionPreference = 'Stop' $content = [IO.File]::ReadAllText($Path) $runcmdCount = [regex]::Matches($content, '(?m)^runcmd:\s*$').Count $launcherPattern = [regex]::Escape('for d in /boot/firmware /boot; do [ -f "$d/waouw-activate.sh" ] && exec bash "$d/waouw-activate.sh"; done; echo waouw-activate.sh introuvable >&2; exit 1') $hasLauncher = $content -match $launcherPattern if ($runcmdCount -ne 1 -or -not $hasLauncher) { exit 9 }