Update TGBeta.ps1
This commit is contained in:
89
TGBeta.ps1
89
TGBeta.ps1
@@ -6,15 +6,10 @@
|
|||||||
### Install-SVSHelpDesk
|
### Install-SVSHelpDesk
|
||||||
### Install SVSWatchtower
|
### Install SVSWatchtower
|
||||||
|
|
||||||
|
### Missing the /installSVSMSPModule in the powershell section
|
||||||
|
|
||||||
### add tweak to set default provider, add to toolkit?
|
### 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)
|
# 1) CREATE A GLOBAL LOG CACHE (NEW)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -184,17 +179,17 @@ function Install-SVSMSP {
|
|||||||
|
|
||||||
# Log file path
|
# Log file path
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$LogFilePath = "$env:temp\svstoolkit.log",
|
[string]$LogFilePath = "$env:SVSMSP\svstoolkit.log",
|
||||||
|
|
||||||
# DRMM API Settings
|
# DRMM API Settings
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$ApiUrl = "https://example-api-url.com",
|
[string]$ApiUrl,
|
||||||
|
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$ApiKey = "YOUR_API_KEY_HERE",
|
[string]$ApiKey,
|
||||||
|
|
||||||
[Parameter(Mandatory = $false)]
|
[Parameter(Mandatory = $false)]
|
||||||
[string]$ApiSecretKey = "YOUR_API_SECRET_HERE"
|
[string]$ApiSecretKey
|
||||||
)
|
)
|
||||||
|
|
||||||
function Perform-Cleanup {
|
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" {
|
"/installrmm" {
|
||||||
if ($request.HttpMethod -eq "POST") {
|
if ($request.HttpMethod -eq "POST") {
|
||||||
@@ -1054,15 +1038,18 @@ try {
|
|||||||
|
|
||||||
"/setSVSPowerplan" {
|
"/setSVSPowerplan" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Set-SVSPowerPlan
|
Set-SVSPowerPlan
|
||||||
$responseString = "Setting SVS PowerPlan triggered successfully."
|
$responseString = "Setting SVS PowerPlan triggered successfully."
|
||||||
$response.StatusCode = 200
|
$response.StatusCode = 200
|
||||||
} catch {
|
} catch {
|
||||||
$responseString = "Error triggering Setting PowerPlan: $_"
|
$responseString = "Error triggering Setting SVS PowerPlan: $_"
|
||||||
$response.StatusCode = 500
|
$response.StatusCode = 500
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$responseString = "Method not allowed. Use GET."
|
||||||
|
$response.StatusCode = 405
|
||||||
}
|
}
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
@@ -1096,9 +1083,18 @@ try {
|
|||||||
|
|
||||||
"/installSplashtop" {
|
"/installSplashtop" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
|
try {
|
||||||
Install-Splashtop
|
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)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
$response.ContentLength64 = $buffer.Length
|
$response.ContentLength64 = $buffer.Length
|
||||||
@@ -1108,9 +1104,18 @@ try {
|
|||||||
|
|
||||||
"/installRocketCyber" {
|
"/installRocketCyber" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
|
try {
|
||||||
Install-RocketCyber
|
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
|
||||||
}
|
}
|
||||||
$responseString = "Install RocketCyber triggered."
|
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
$response.ContentLength64 = $buffer.Length
|
$response.ContentLength64 = $buffer.Length
|
||||||
@@ -1120,9 +1125,18 @@ try {
|
|||||||
|
|
||||||
"/installThreatLocker" {
|
"/installThreatLocker" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
|
try {
|
||||||
Install-ThreatLocker
|
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
|
||||||
}
|
}
|
||||||
$responseString = "Install ThreatLocker triggered."
|
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
$response.ContentLength64 = $buffer.Length
|
$response.ContentLength64 = $buffer.Length
|
||||||
@@ -1132,9 +1146,18 @@ try {
|
|||||||
|
|
||||||
"/installSVSHelpDesk" {
|
"/installSVSHelpDesk" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
|
try {
|
||||||
Install-SVSHelpDesk
|
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
|
||||||
}
|
}
|
||||||
$responseString = "Install SVSHelpDesk triggered."
|
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
$response.ContentLength64 = $buffer.Length
|
$response.ContentLength64 = $buffer.Length
|
||||||
@@ -1145,8 +1168,18 @@ try {
|
|||||||
"/installSVSWatchtower" {
|
"/installSVSWatchtower" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
Install-SVSWatchtower
|
Install-SVSWatchtower
|
||||||
|
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
|
||||||
}
|
}
|
||||||
$responseString = "Install SVSWatchtower triggered."
|
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseString)
|
||||||
$response.ContentType = "text/plain"
|
$response.ContentType = "text/plain"
|
||||||
$response.ContentLength64 = $buffer.Length
|
$response.ContentLength64 = $buffer.Length
|
||||||
|
|||||||
Reference in New Issue
Block a user