param()
$ErrorActionPreference='SilentlyContinue'
Get-CimInstance Win32_Process |
  Where-Object {
    $_.Name -match 'xmath-print-bridge|powershell|python|cmd' -and
    ($_.CommandLine -match 'xmath-print-bridge|print_bridge|bridge.py|run_print_bridge.bat')
  } |
  ForEach-Object { Stop-Process -Id $_.ProcessId -Force }
Write-Host 'print bridge related processes stopped.'
