<# .SYNOPSIS Stops + removes the v2 services. Mirrors Install-Services.ps1. .DESCRIPTION PR 7.2 retired the legacy OtOpcUaGalaxyHost service. Galaxy access now flows through the in-process GalaxyDriver against a separately-installed mxaccessgw. OtOpcUaGalaxyHost is included in the cleanup loop below so this script safely removes it from any rig still carrying the legacy service from a pre-7.2 install. #> [CmdletBinding()] param() $ErrorActionPreference = 'Continue' foreach ($svc in 'OtOpcUa', 'OtOpcUaWonderwareHistorian', '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."