Update TGBeta.ps1
This commit is contained in:
97
TGBeta.ps1
97
TGBeta.ps1
@@ -1498,54 +1498,59 @@ try {
|
|||||||
$response.OutputStream.Close()
|
$response.OutputStream.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($request.Url.AbsolutePath) {
|
while ($listener.IsListening) {
|
||||||
"/offboard/uninstallSVSMSPModule" {
|
$context = $listener.GetContext()
|
||||||
try {
|
$request = $context.Request
|
||||||
|
$response = $context.Response
|
||||||
$responseString = "Uninstalled SVSMSP Module successfully."
|
switch ($request.Url.AbsolutePath) {
|
||||||
$response.StatusCode = 200
|
"/offboard/uninstallSVSMSPModule" {
|
||||||
} catch {
|
try {
|
||||||
$responseString = "Error uninstalling SVSMSP Module: $_"
|
|
||||||
$response.StatusCode = 500
|
$responseString = "Uninstalled SVSMSP Module successfully."
|
||||||
|
$response.StatusCode = 200
|
||||||
|
} catch {
|
||||||
|
$responseString = "Error uninstalling SVSMSP Module: $_"
|
||||||
|
$response.StatusCode = 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"/offboard/uninstallThreatLocker" {
|
||||||
|
try {
|
||||||
|
|
||||||
|
$responseString = "Uninstalled ThreatLocker successfully."
|
||||||
|
$response.StatusCode = 200
|
||||||
|
} catch {
|
||||||
|
$responseString = "Error uninstalling ThreatLocker: $_"
|
||||||
|
$response.StatusCode = 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"/offboard/uninstallCyberQP" {
|
||||||
|
try {
|
||||||
|
|
||||||
|
$responseString = "Uninstalled CyberQP successfully."
|
||||||
|
$response.StatusCode = 200
|
||||||
|
} catch {
|
||||||
|
$responseString = "Error uninstalling CyberQP: $_"
|
||||||
|
$response.StatusCode = 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add routes for other tasks here...
|
||||||
|
|
||||||
|
default {
|
||||||
|
$response.StatusCode = 404
|
||||||
|
$responseString = "Task not found."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
"/offboard/uninstallThreatLocker" {
|
|
||||||
try {
|
|
||||||
|
|
||||||
$responseString = "Uninstalled ThreatLocker successfully."
|
|
||||||
$response.StatusCode = 200
|
|
||||||
} catch {
|
|
||||||
$responseString = "Error uninstalling ThreatLocker: $_"
|
|
||||||
$response.StatusCode = 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
"/offboard/uninstallCyberQP" {
|
|
||||||
try {
|
|
||||||
|
|
||||||
$responseString = "Uninstalled CyberQP successfully."
|
|
||||||
$response.StatusCode = 200
|
|
||||||
} catch {
|
|
||||||
$responseString = "Error uninstalling CyberQP: $_"
|
|
||||||
$response.StatusCode = 500
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add routes for other tasks here...
|
|
||||||
|
|
||||||
default {
|
|
||||||
$response.StatusCode = 404
|
|
||||||
$responseString = "Task not found."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
# Send the response
|
# Send the response
|
||||||
$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
|
||||||
$response.OutputStream.Write($buffer, 0, $buffer.Length)
|
$response.OutputStream.Write($buffer, 0, $buffer.Length)
|
||||||
$response.OutputStream.Close()
|
$response.OutputStream.Close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user