# process-running.ps1 — is X.exe running? $Url = "YOUR_URL/process" $Process = "notepad" # name without .exe $Procs = @(Get-Process -Name $Process -ErrorAction SilentlyContinue) $Body = (@{ hostname = $env:COMPUTERNAME process = $Process running = ($Procs.Count -gt 0) count = $Procs.Count }) | ConvertTo-Json -Compress Invoke-RestMethod -Uri $Url -Method Post -Body $Body ` -ContentType "application/json" -TimeoutSec 15 | Out-Null