# Copyright 2026 Sverse contributors. Licensed under the Apache License, Version 2.0. [CmdletBinding()] param() $ErrorActionPreference = 'Stop' $spatialRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..')) $spatialRuntime = [IO.Path]::GetFullPath((Join-Path $spatialRoot '.spatial-runtime')) + [IO.Path]::DirectorySeparatorChar # Select only this checkout's development binaries; never stop by name alone. Get-CimInstance Win32_Process | Where-Object { $_.ExecutablePath -and $_.ExecutablePath.StartsWith($spatialRuntime, [StringComparison]::OrdinalIgnoreCase) -and ([IO.Path]::GetFileName($_.ExecutablePath) -match '^(livekit-server|spatial-test)(-[a-z0-9-]+)?\.exe$') } | ForEach-Object { Stop-Process -Id $_.ProcessId Wait-Process -Id $_.ProcessId -Timeout 10 -ErrorAction SilentlyContinue Write-Host "Stopped PID $($_.ProcessId)" }