diff --git a/TGBeta.ps1 b/TGBeta.ps1 index 11bda61..14da762 100644 --- a/TGBeta.ps1 +++ b/TGBeta.ps1 @@ -6,10 +6,15 @@ ### Install-SVSHelpDesk ### Install SVSWatchtower -### Missing the /installSVSMSPModule in the powershell section + ### add tweak to set default provider, add to toolkit? +###### Work in progress +### Missing the /installSVSMSPModule in the powershell section +### fixing all the /install... + + # --------------------------------------------------------------------------- # 1) CREATE A GLOBAL LOG CACHE (NEW) # --------------------------------------------------------------------------- @@ -957,6 +962,19 @@ try { } } + "/installSVSMSPModule" { + if ($request.HttpMethod -eq "GET") { + Install-SVSMSP -InstallToolkit + + } + $responseString = "Install SVSMSP Module triggered." + $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") { try { @@ -1036,9 +1054,16 @@ try { "/setSVSPowerplan" { if ($request.HttpMethod -eq "GET") { - Set-SVSPowerPlan + try { + Set-SVSPowerPlan + $responseString = "Setting SVSPowerPlan triggered successfully." + $response.StatusCode = 200 + } catch { + $responseString = "Error triggering Setting PowerPlan: $_" + $response.StatusCode = 500 + } + } - $responseString = "Install SVS Powerplan triggered." $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString) $response.ContentType = "text/plain" $response.ContentLength64 = $buffer.Length @@ -1061,7 +1086,6 @@ try { $responseString = "Method not allowed. Use GET." $response.StatusCode = 405 } - $buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString) $response.ContentType = "text/plain" $response.ContentLength64 = $buffer.Length