Update TGBeta.ps1

This commit is contained in:
2025-01-06 11:23:55 -05:00
parent ac2ef36bd4
commit 5a2bbaba71

View File

@@ -6,15 +6,10 @@
### 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)
# ---------------------------------------------------------------------------
@@ -184,17 +179,17 @@ function Install-SVSMSP {
# Log file path
[Parameter(Mandatory = $false)]
[string]$LogFilePath = "$env:temp\svstoolkit.log",
[string]$LogFilePath = "$env:SVSMSP\svstoolkit.log",
# DRMM API Settings
[Parameter(Mandatory = $false)]
[string]$ApiUrl = "https://example-api-url.com",
[string]$ApiUrl,
[Parameter(Mandatory = $false)]
[string]$ApiKey = "YOUR_API_KEY_HERE",
[string]$ApiKey,
[Parameter(Mandatory = $false)]
[string]$ApiSecretKey = "YOUR_API_SECRET_HERE"
[string]$ApiSecretKey
)
function Perform-Cleanup {
@@ -962,18 +957,7 @@ 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") {
@@ -1054,15 +1038,18 @@ try {
"/setSVSPowerplan" {
if ($request.HttpMethod -eq "GET") {
try {
try {
Set-SVSPowerPlan
$responseString = "Setting SVSPowerPlan triggered successfully."
$responseString = "Setting SVS PowerPlan triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Setting PowerPlan: $_"
$responseString = "Error triggering Setting SVS PowerPlan: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
@@ -1096,9 +1083,18 @@ try {
"/installSplashtop" {
if ($request.HttpMethod -eq "GET") {
Install-Splashtop
try {
Install-Splashtop
$responseString = "Install Splashtop triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Install Splashtop: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$responseString = "Install Splashtop triggered."
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length
@@ -1108,9 +1104,18 @@ try {
"/installRocketCyber" {
if ($request.HttpMethod -eq "GET") {
Install-RocketCyber
}
$responseString = "Install RocketCyber triggered."
try {
Install-RocketCyber
$responseString = "Install RocketCyber triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Install RocketCyber: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length
@@ -1120,9 +1125,18 @@ try {
"/installThreatLocker" {
if ($request.HttpMethod -eq "GET") {
Install-ThreatLocker
}
$responseString = "Install ThreatLocker triggered."
try {
Install-ThreatLocker
$responseString = "Install ThreatLocker triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Install ThreatLocker: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length
@@ -1132,9 +1146,18 @@ try {
"/installSVSHelpDesk" {
if ($request.HttpMethod -eq "GET") {
Install-SVSHelpDesk
}
$responseString = "Install SVSHelpDesk triggered."
try {
Install-SVSHelpDesk
$responseString = "Install SVSHelpDesk triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Install SVSHelpDesk: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length
@@ -1145,8 +1168,18 @@ try {
"/installSVSWatchtower" {
if ($request.HttpMethod -eq "GET") {
Install-SVSWatchtower
}
$responseString = "Install SVSWatchtower triggered."
try {
Install-SVSWatchtower
$responseString = "Install SVSWatchtower triggered successfully."
$response.StatusCode = 200
} catch {
$responseString = "Error triggering Install SVSWatchtower: $_"
$response.StatusCode = 500
}
} else {
$responseString = "Method not allowed. Use GET."
$response.StatusCode = 405
}
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
$response.ContentType = "text/plain"
$response.ContentLength64 = $buffer.Length