Update TGBeta.ps1

This commit is contained in:
2025-01-07 21:40:31 -05:00
parent b0b14eae94
commit cdda7889d0

View File

@@ -3,18 +3,17 @@
### set the priority in the js code so it waits for one function to complete before starting the next one ### set the priority in the js code so it waits for one function to complete before starting the next one
### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding" ### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding"
### need new logo and the RGB color codes form john ### need new logo and the RGB color codes form john
### add Set-EdgeDefaultSearchEngine to the Tweaks list
### add an "off board" button
### add "run tweaks" button
### add the .net silent install tweaks to toolkit ### add the .net silent install tweaks to toolkit
### for the reg tweak need to do/undo function maybe it should have it own check box list ### for the reg tweak need to do/undo function maybe it should have it own check box list
### new tab for client apps? ### new tab for client apps?
### need to add the set-DefaultEdgeSearchProvider to the module
############################################################# #############################################################
### Changes done ### Changes done
### added the Tweaks and Offboard buttons
### added the Set-DefaultEdgeSearchProvider
### minor change the the param of install-svsmsp ### minor change the the param of install-svsmsp
### commented out line 64 ### commented out line 64
### moved logo to the left in line 384 ### moved logo to the left in line 384
@@ -145,6 +144,9 @@ else {
Write-LogHybrid -Message "Starting SVS TaskGate" -Level "Info" -TaskCategory "SVSTaskGate" -LogToEvent:$true Write-LogHybrid -Message "Starting SVS TaskGate" -Level "Info" -TaskCategory "SVSTaskGate" -LogToEvent:$true
#endregion #endregion
#region SVS Module #region SVS Module
function Install-SVSMSP { function Install-SVSMSP {
param ( param (
# Cleanup flag # Cleanup flag
@@ -203,6 +205,9 @@ function Install-SVSMSP {
[string]$ApiSecretKey [string]$ApiSecretKey
) )
function Perform-Cleanup { function Perform-Cleanup {
Write-LogHybrid -Message "Cleanup mode enabled. Starting cleanup process..." -Level "Info" -LogToEvent Write-LogHybrid -Message "Cleanup mode enabled. Starting cleanup process..." -Level "Info" -LogToEvent
@@ -588,9 +593,7 @@ function GetHtmlContent {
<button class="install-button" onclick="triggerInstall()">Install</button> <button class="install-button" onclick="triggerInstall()">Install</button>
</div> </div>
<div class="log" id="logArea">
<p>Logs will appear here...</p>
</div>
</div> </div>
<!-- Off-Boarding Tab --> <!-- Off-Boarding Tab -->
<div id="offboardTab" class="tab-content inactive"> <div id="offboardTab" class="tab-content inactive">
@@ -608,6 +611,9 @@ function GetHtmlContent {
<input type="checkbox" name="uninstallThreatLocker" id="uninstallThreatLockerCheckbox"> <input type="checkbox" name="uninstallThreatLocker" id="uninstallThreatLockerCheckbox">
Uninstall ThreatLocker Uninstall ThreatLocker
</label> </label>
<div class="button-group">
<button class="install-button" onclick="triggerOffboard()">Offboard</button>
</div>
</div> </div>
</div> </div>
<!-- tweaks Tab --> <!-- tweaks Tab -->
@@ -619,7 +625,7 @@ function GetHtmlContent {
Select All Select All
</label> </label>
<label> <label>
<input type="checkbox" name="enableDarkMode" id="enableDarkModeCheckbox"> <input type="checkbox" name="setedgedefaultsearch" id="setedgedefaultsearchCheckbox">
Set Edge Default Search Engine Set Edge Default Search Engine
</label> </label>
<label> <label>
@@ -635,11 +641,19 @@ function GetHtmlContent {
Increase Font Size Increase Font Size
</label> </label>
</div> </div>
<div class="button-group">
<button class="install-button" onclick="triggerTweaks()">Tweaks</button>
</div>
</div> </div>
<!-- Shared Exit Button --> <!-- Shared Exit Button -->
<div class="button-group"> <div class="button-group">
<button class="exit-button" onclick="endSession()">Exit</button> <button class="exit-button" onclick="endSession()">Exit</button>
</div> </div>
<!-- Log Area -->
<div class="log" id="logArea">
<p>Logs will appear here...</p>
</div>
</div> </div>
<script> <script>
@@ -712,6 +726,10 @@ function GetHtmlContent {
checkbox.addEventListener('change', updateSelectAllOffboard); checkbox.addEventListener('change', updateSelectAllOffboard);
}); });
function triggerOffboard() {
appendLog("testeteteteteteet")
}
function toggleTweaksCheckboxes(selectAllCheckbox) { function toggleTweaksCheckboxes(selectAllCheckbox) {
// Get all checkboxes inside the tweaksTab container // Get all checkboxes inside the tweaksTab container
const checkboxes = document const checkboxes = document
@@ -739,6 +757,15 @@ function GetHtmlContent {
checkbox.addEventListener('change', updateSelectAllTweaks); checkbox.addEventListener('change', updateSelectAllTweaks);
}); });
function triggerTweaks() {
const setedgedefaultsearch = document.querySelector('input[name="setedgedefaultsearch"]');
if (setedgedefaultsearch.checked) {
fetch('/setedgedefaultsearch', { method: 'GET' })
}
}
function toggleDattoRMMOptions() { function toggleDattoRMMOptions() {
const checkbox = document.getElementById('installDattoRMMCheckbox'); const checkbox = document.getElementById('installDattoRMMCheckbox');
@@ -1210,6 +1237,29 @@ try {
$response.OutputStream.Close() $response.OutputStream.Close()
} }
"/setedgedefaultsearch"{
if ($request.HttpMethod -eq "GET") {
write-host "it attempted it!"
try {
set-EdgeDefaultSearchProvider
$responseString = "setedgedefaultsearch 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
$response.OutputStream.Write($buffer, 0, $buffer.Length)
$response.OutputStream.Close()
}
"/installSVSHelpDesk" { "/installSVSHelpDesk" {
if ($request.HttpMethod -eq "GET") { if ($request.HttpMethod -eq "GET") {
try { try {