From 61e830b9f49a63073a9faaaa31d9ef30c99b56f5 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sat, 4 Jan 2025 03:36:52 -0500 Subject: [PATCH] Update SVSTaskGate.ps1 --- SVSTaskGate.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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" {