??# post_bootpack_pointer_refresh_v1.0.3.ps1 - refresh pointer + optional acceptance (non-interactive) param( [Parameter(Mandatory=$true)][string]$Root, [switch]$NoPrompt, [switch]$Verify ) try{ [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false) }catch{} $scripts = Join-Path $Root 'scripts' $ptr = Join-Path $scripts 'kb_pointer_refresh_v1.0.ps1' $acc = Join-Path $scripts 'kb_acceptance_tests_v1.0.1.ps1' function Exists([string]$p){ return (-not [string]::IsNullOrWhiteSpace($p)) -and (Test-Path -LiteralPath $p) } function Run([string]$tool,[string[]]$argv){ $null = & powershell -NoProfile -ExecutionPolicy Bypass -File $tool @argv; return [int]$LASTEXITCODE } if(-not (Exists $ptr)){ Write-Host ("[ERROR] missing: {0}" -f $ptr); exit 3 } # 1) refresh pointer (force write, non-interactif) $rc = Run $ptr @('-RegistryRoot',$Root,'-Write') if($rc -ne 0){ Write-Host ("[ERROR] pointer refresh rc={0}" -f $rc); exit 3 } if($Verify){ if(-not (Exists $acc)){ Write-Host ("[WARN] acceptance missing: {0}" -f $acc); exit 0 } $rc = Run $acc @($Root) if($rc -ne 0){ Write-Host ("[FAIL] acceptance rc={0}" -f $rc); exit 2 } } Write-Host '[OK] post_bootpack_pointer_refresh done.' exit 0