<#
.SYNOPSIS
    Stops + removes the two v2 services. Mirrors Install-Services.ps1.
#>
[CmdletBinding()] param()
$ErrorActionPreference = 'Continue'

foreach ($svc in 'OtOpcUa', 'OtOpcUaGalaxyHost') {
    if (Get-Service $svc -ErrorAction SilentlyContinue) {
        Write-Host "Stopping $svc..."
        Stop-Service $svc -Force -ErrorAction SilentlyContinue
        Write-Host "Removing $svc..."
        & sc.exe delete $svc | Out-Null
    } else {
        Write-Host "$svc not installed — skipping"
    }
}
Write-Host "Done."
