Update SVSTaskGate.ps1
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
### Known issues as of January 5 2025
|
||||
|
||||
### To Modify of January 5 2025
|
||||
|
||||
### 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 tweak to set default provider, add to toolkit?
|
||||
### 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?
|
||||
|
||||
|
||||
#############################################################
|
||||
|
||||
### Changes done
|
||||
|
||||
### minor change the the param of install-svsmsp
|
||||
### commented out line 64
|
||||
### moved logo to the left in line 384
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 1) CREATE A GLOBAL LOG CACHE (NEW)
|
||||
@@ -54,7 +71,7 @@ if (-not (Get-Command -Name Write-Log -CommandType Function -ErrorAction Silentl
|
||||
}
|
||||
|
||||
# Write to the PowerShell console
|
||||
Write-Host "$Icon [$Level] [$TaskCategory] $Message (Event ID: $EventID)" -ForegroundColor $Color
|
||||
# Write-Host "$Icon [$Level] [$TaskCategory] $Message (Event ID: $EventID)" -ForegroundColor $Color
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# 2) ALSO STORE THE LOG IN OUR GLOBAL LOG CACHE (NEW)
|
||||
@@ -165,7 +182,9 @@ function Install-SVSMSP {
|
||||
"Install-CyberQP",
|
||||
"Install-RocketCyber",
|
||||
"Install-Splashtop",
|
||||
"Install-ThreatLocker"
|
||||
"Install-ThreatLocker",
|
||||
"Install-SVSHelpdesk",
|
||||
"Install-SVSWatchtower"
|
||||
),
|
||||
|
||||
# Log file path
|
||||
@@ -184,7 +203,7 @@ function Install-SVSMSP {
|
||||
)
|
||||
|
||||
function Perform-Cleanup {
|
||||
Write-LogHybrid -Message "Cleanup mode enabled. Starting cleanup process..." -Level "Info" -LogToEvent -EventID 1502
|
||||
Write-LogHybrid -Message "Cleanup mode enabled. Starting cleanup process..." -Level "Info" -LogToEvent
|
||||
|
||||
# Step 1: Remove all old modules
|
||||
Write-LogHybrid -Message "Starting cleanup of old modules..." -Level "Info" -LogToEvent
|
||||
@@ -226,7 +245,7 @@ function Install-SVSMSP {
|
||||
}
|
||||
}
|
||||
|
||||
Write-LogHybrid -Message "Cleanup process completed successfully." -Level "Success" -LogToEvent -EventID 1510
|
||||
Write-LogHybrid -Message "Cleanup process completed successfully." -Level "Success" -LogToEvent
|
||||
}
|
||||
|
||||
function Perform-ToolkitInstallation {
|
||||
@@ -236,29 +255,29 @@ function Install-SVSMSP {
|
||||
# Step 1: Set Execution Policy
|
||||
$localMachineExecutionPolicy = Get-ExecutionPolicy -Scope LocalMachine
|
||||
if ($localMachineExecutionPolicy -ne "RemoteSigned") {
|
||||
Write-LogHybrid -Message "Setting execution policy to RemoteSigned..." -Level "Warning" -LogToEvent -EventID 1522
|
||||
Write-LogHybrid -Message "Setting execution policy to RemoteSigned..." -Level "Warning" -LogToEvent
|
||||
try {
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
|
||||
Write-LogHybrid -Message "Execution policy set to RemoteSigned successfully." -Level "Success" -LogToEvent -EventID 1513
|
||||
Write-LogHybrid -Message "Execution policy set to RemoteSigned successfully." -Level "Success" -LogToEvent
|
||||
}
|
||||
catch {
|
||||
Write-LogHybrid -Message "Failed to set execution policy. Error: $_" -Level "Error" -LogToEvent -EventID 1534
|
||||
Write-LogHybrid -Message "Failed to set execution policy. Error: $_" -Level "Error" -LogToEvent
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
# Step 2: Ensure NuGet is Installed
|
||||
if (!(Get-PackageProvider -Name "NuGet" -ErrorAction SilentlyContinue)) {
|
||||
Write-LogHybrid -Message "NuGet package provider not found. Installing..." -Level "Warning" -LogToEvent -EventID 1520
|
||||
try {
|
||||
#if (!(Get-PackageProvider -Name "NuGet" -ErrorAction SilentlyContinue)) {
|
||||
# Write-LogHybrid -Message "NuGet package provider not found. Installing..." -Level "Warning" -LogToEvent
|
||||
# try {
|
||||
Install-PackageProvider -Name "NuGet" -Force -Scope AllUsers -Confirm:$false
|
||||
Write-LogHybrid -Message "NuGet package provider installed successfully." -Level "Success" -LogToEvent -EventID 1514
|
||||
}
|
||||
catch {
|
||||
Write-LogHybrid -Message "Failed to install NuGet package provider. Error: $_" -Level "Error" -LogToEvent -EventID 1535
|
||||
return
|
||||
}
|
||||
}
|
||||
# Write-LogHybrid -Message "NuGet package provider installed successfully." -Level "Success" -LogToEvent
|
||||
# }
|
||||
# catch {
|
||||
# Write-LogHybrid -Message "Failed to install NuGet package provider. Error: $_" -Level "Error" -LogToEvent
|
||||
# return
|
||||
# }
|
||||
#}
|
||||
|
||||
# Step 3: Register the new repository
|
||||
Write-LogHybrid -Message "Registering the new repository '$NewRepositoryName'..." -Level "Info" -LogToEvent
|
||||
@@ -282,10 +301,10 @@ function Install-SVSMSP {
|
||||
Write-LogHybrid -Message "Failed to install new module '$NewModuleName'. Error: $($_.Exception.Message)" -Level "Error" -LogToEvent
|
||||
}
|
||||
|
||||
Write-LogHybrid -Message "Toolkit installation process completed successfully." -Level "Success" -LogToEvent -EventID 1510
|
||||
Write-LogHybrid -Message "Toolkit installation process completed successfully." -Level "Success" -LogToEvent
|
||||
}
|
||||
|
||||
Write-LogHybrid -Message "Install-SVSMSP function started." -Level "Info" -LogToEvent -EventID 1500
|
||||
Write-LogHybrid -Message "Install-SVSMSP function started." -Level "Info" -LogToEvent
|
||||
|
||||
if ($Cleanup) {
|
||||
Perform-Cleanup
|
||||
@@ -297,7 +316,7 @@ function Install-SVSMSP {
|
||||
return
|
||||
}
|
||||
|
||||
Write-LogHybrid -Message "No specific mode specified. Defaulting to toolkit installation mode..." -Level "Info" -LogToEvent -EventID 1504
|
||||
Write-LogHybrid -Message "No specific mode specified. Defaulting to toolkit installation mode..." -Level "Info" -LogToEvent
|
||||
Perform-ToolkitInstallation
|
||||
}
|
||||
|
||||
@@ -372,7 +391,7 @@ function GetHtmlContent {
|
||||
color: #ffffff;
|
||||
}
|
||||
.logo-container {
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
background-color: #1e1e1e; /* Matches the background color */
|
||||
}
|
||||
@@ -632,6 +651,8 @@ function GetHtmlContent {
|
||||
const n8nPasswordContainer = document.getElementById('n8nPasswordContainer');
|
||||
const dattoRMMContainer = document.getElementById('DattoRMMContainer');
|
||||
|
||||
|
||||
|
||||
checkboxes.forEach(checkbox => {
|
||||
if (checkbox !== selectedCheckbox) {
|
||||
checkbox.checked = selectedCheckbox.checked;
|
||||
@@ -649,6 +670,21 @@ function GetHtmlContent {
|
||||
}
|
||||
}
|
||||
|
||||
function updateSelectAllonboard() {
|
||||
const selectAllCheckbox = document.getElementById('selectAllOnboardCheckbox');
|
||||
const checkboxes = document
|
||||
.getElementById('onboardTab')
|
||||
.querySelectorAll('input[type="checkbox"]:not(#selectAllOnboardCheckbox)');
|
||||
|
||||
// If any checkbox is unchecked, uncheck "Select All"
|
||||
selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked);
|
||||
}
|
||||
|
||||
// Attach the updateSelectAllonboard function to all individual checkboxes
|
||||
document.querySelectorAll('#onboardTab input[type="checkbox"]:not(#selectAllOnboardCheckbox)').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', updateSelectAllonboard);
|
||||
});
|
||||
|
||||
function toggleOffboardCheckboxes(selectAllCheckbox) {
|
||||
// Get all checkboxes inside the offboardTab container
|
||||
const checkboxes = document
|
||||
@@ -661,6 +697,22 @@ function GetHtmlContent {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function updateSelectAllOffboard() {
|
||||
const selectAllCheckbox = document.getElementById('selectAllOffboardCheckbox');
|
||||
const checkboxes = document
|
||||
.getElementById('offboardTab')
|
||||
.querySelectorAll('input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
|
||||
|
||||
// If any checkbox is unchecked, uncheck "Select All"
|
||||
selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked);
|
||||
}
|
||||
|
||||
// Attach the updateSelectAllOffboard function to all individual checkboxes
|
||||
document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', updateSelectAllOffboard);
|
||||
});
|
||||
|
||||
function toggleTweaksCheckboxes(selectAllCheckbox) {
|
||||
// Get all checkboxes inside the tweaksTab container
|
||||
const checkboxes = document
|
||||
|
||||
Reference in New Issue
Block a user