Update TGBeta.ps1
This commit is contained in:
66
TGBeta.ps1
66
TGBeta.ps1
@@ -3,18 +3,17 @@
|
||||
### 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"
|
||||
### 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
|
||||
### for the reg tweak need to do/undo function maybe it should have it own check box list
|
||||
### new tab for client apps?
|
||||
|
||||
### need to add the set-DefaultEdgeSearchProvider to the module
|
||||
|
||||
#############################################################
|
||||
|
||||
### Changes done
|
||||
|
||||
### added the Tweaks and Offboard buttons
|
||||
### added the Set-DefaultEdgeSearchProvider
|
||||
### minor change the the param of install-svsmsp
|
||||
### commented out line 64
|
||||
### 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
|
||||
#endregion
|
||||
#region SVS Module
|
||||
|
||||
|
||||
|
||||
function Install-SVSMSP {
|
||||
param (
|
||||
# Cleanup flag
|
||||
@@ -203,6 +205,9 @@ function Install-SVSMSP {
|
||||
[string]$ApiSecretKey
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
function Perform-Cleanup {
|
||||
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>
|
||||
|
||||
</div>
|
||||
<div class="log" id="logArea">
|
||||
<p>Logs will appear here...</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Off-Boarding Tab -->
|
||||
<div id="offboardTab" class="tab-content inactive">
|
||||
@@ -608,6 +611,9 @@ function GetHtmlContent {
|
||||
<input type="checkbox" name="uninstallThreatLocker" id="uninstallThreatLockerCheckbox">
|
||||
Uninstall ThreatLocker
|
||||
</label>
|
||||
<div class="button-group">
|
||||
<button class="install-button" onclick="triggerOffboard()">Offboard</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- tweaks Tab -->
|
||||
@@ -619,7 +625,7 @@ function GetHtmlContent {
|
||||
Select All
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="enableDarkMode" id="enableDarkModeCheckbox">
|
||||
<input type="checkbox" name="setedgedefaultsearch" id="setedgedefaultsearchCheckbox">
|
||||
Set Edge Default Search Engine
|
||||
</label>
|
||||
<label>
|
||||
@@ -635,11 +641,19 @@ function GetHtmlContent {
|
||||
Increase Font Size
|
||||
</label>
|
||||
</div>
|
||||
<div class="button-group">
|
||||
<button class="install-button" onclick="triggerTweaks()">Tweaks</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Shared Exit Button -->
|
||||
<div class="button-group">
|
||||
<button class="exit-button" onclick="endSession()">Exit</button>
|
||||
</div>
|
||||
|
||||
<!-- Log Area -->
|
||||
<div class="log" id="logArea">
|
||||
<p>Logs will appear here...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -712,6 +726,10 @@ function GetHtmlContent {
|
||||
checkbox.addEventListener('change', updateSelectAllOffboard);
|
||||
});
|
||||
|
||||
function triggerOffboard() {
|
||||
appendLog("testeteteteteteet")
|
||||
}
|
||||
|
||||
function toggleTweaksCheckboxes(selectAllCheckbox) {
|
||||
// Get all checkboxes inside the tweaksTab container
|
||||
const checkboxes = document
|
||||
@@ -739,6 +757,15 @@ function GetHtmlContent {
|
||||
checkbox.addEventListener('change', updateSelectAllTweaks);
|
||||
});
|
||||
|
||||
function triggerTweaks() {
|
||||
const setedgedefaultsearch = document.querySelector('input[name="setedgedefaultsearch"]');
|
||||
|
||||
|
||||
if (setedgedefaultsearch.checked) {
|
||||
fetch('/setedgedefaultsearch', { method: 'GET' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleDattoRMMOptions() {
|
||||
const checkbox = document.getElementById('installDattoRMMCheckbox');
|
||||
@@ -1210,6 +1237,29 @@ try {
|
||||
$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" {
|
||||
if ($request.HttpMethod -eq "GET") {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user