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