From ec68c0ac93a4af6a13bf3969c700bd0592de45ee Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sat, 4 Jan 2025 00:35:41 -0500 Subject: [PATCH] Update SVSTaskGate.ps1 --- SVSTaskGate.ps1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/SVSTaskGate.ps1 b/SVSTaskGate.ps1 index 7817ee2..16eb909 100644 --- a/SVSTaskGate.ps1 +++ b/SVSTaskGate.ps1 @@ -867,6 +867,39 @@ try { } } + "/installsvsmspmodule" { + if ($request.HttpMethod -eq "GET") { + try { + Write-LogHybrid -Message "Installing SVSMSP Module..." -Level "Info" + + # Add your installation logic here + Install-Module -Name SVSMSP -Force -Scope AllUsers + + Write-LogHybrid -Message "SVSMSP Module installed successfully." -Level "Success" + + $responseString = "SVSMSP Module installation completed." + $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() + } + catch { + Write-LogHybrid -Message "Error installing SVSMSP Module: $($_.Exception.Message)" -Level "Error" + + $response.StatusCode = 500 + $responseString = "Failed to install SVSMSP Module." + $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() + } + } + } + + + "/installrmm" { if ($request.HttpMethod -eq "POST") { $bodyStream = New-Object IO.StreamReader $request.InputStream