diff --git a/SVSTaskGate.ps1 b/SVSTaskGate.ps1 index 0ae19d6..5cddd94 100644 --- a/SVSTaskGate.ps1 +++ b/SVSTaskGate.ps1 @@ -916,14 +916,25 @@ try { "/installCyberQP" { if ($request.HttpMethod -eq "GET") { - Install-CyberQP + try { + Install-CyberQP + $responseString = "Install CyberQP triggered successfully." + $response.StatusCode = 200 + } catch { + $responseString = "Error triggering Install CyberQP: $_" + $response.StatusCode = 500 + } + } else { + $responseString = "Method not allowed. Use GET." + $response.StatusCode = 405 } - $responseString = "Install CyberQP triggered." - $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString) - $response.ContentType = "text/plain" + + $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString) + $response.ContentType = "text/plain" $response.ContentLength64 = $buffer.Length $response.OutputStream.Write($buffer, 0, $buffer.Length) $response.OutputStream.Close() + } "/installSplashtop" {