param(
    [string]$InstallDirectory = (Split-Path -Path $PSScriptRoot -Parent)
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$agentExe = Join-Path $InstallDirectory "agent\IAUWP.Agent.exe"
if (-not (Test-Path -Path $agentExe)) { throw "Agent executable was not found at '$agentExe'." }
& $agentExe --supervision-resume
if ($LASTEXITCODE -ne 0) { throw "Supervision resume failed with exit code $LASTEXITCODE." }
