<# launch.ps1 - Launch StickyHomeworks and report its PID. StickyHomeworks is a .NET 8 WPF desktop app. It resolves 'db/app.db' and 'Profile.json' relative to its working directory, so we launch it with the install directory as the working directory. Contract (required by the pipeline): * Output ONLY the numeric PID as the first line (via Write-Output). * No Write-Host, no text before the PID. #> $ErrorActionPreference = 'Stop' $InstallDir = (Join-Path (Split-Path $PSScriptRoot -Parent) 'install') $Exe = Join-Path $InstallDir 'StickyHomeworks.exe' # Ensure the working directory exists (the app writes Profile.json / db there). if (-not (Test-Path $InstallDir)) { New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null } $proc = Start-Process -FilePath $Exe -WorkingDirectory $InstallDir -PassThru Write-Output $proc.Id