Update SVSTaskGate_Beta.ps1
This commit is contained in:
@@ -13,7 +13,7 @@ $Global:LogCache = New-Object System.Collections.ArrayList
|
|||||||
|
|
||||||
|
|
||||||
# Check if the Write-Log function exists
|
# Check if the Write-Log function exists
|
||||||
if (-not (Get-Command -Name Write-Log2 -CommandType Function -ErrorAction SilentlyContinue)) {
|
if (-not (Get-Command -Name Write-Log -CommandType Function -ErrorAction SilentlyContinue)) {
|
||||||
# If the Write-Log function doesn't exist, create the Write-LogHelper function
|
# If the Write-Log function doesn't exist, create the Write-LogHelper function
|
||||||
function Write-LogHelper {
|
function Write-LogHelper {
|
||||||
param (
|
param (
|
||||||
@@ -127,6 +127,7 @@ else {
|
|||||||
|
|
||||||
# Example usage of Write-LogHybrid
|
# Example usage of Write-LogHybrid
|
||||||
Write-LogHybrid -Message "This is a test log message. Write-log2 does exist" -Level "Info" -TaskCategory "TestCategory" -LogToEvent:$true
|
Write-LogHybrid -Message "This is a test log message. Write-log2 does exist" -Level "Info" -TaskCategory "TestCategory" -LogToEvent:$true
|
||||||
|
Write-Log -Message "This is a test log message. Write-log4444 does exist" -Level "Info" -TaskCategory "TestCategory" -LogToEvent:$true
|
||||||
|
|
||||||
|
|
||||||
function Install-SVSMSP {
|
function Install-SVSMSP {
|
||||||
@@ -343,15 +344,7 @@ function Get-N8nWebhookData {
|
|||||||
$global:ApiKey = $data.ApiKey
|
$global:ApiKey = $data.ApiKey
|
||||||
$global:ApiSecretKey = $data.ApiSecretKey
|
$global:ApiSecretKey = $data.ApiSecretKey
|
||||||
|
|
||||||
Write-Output "Module Name: $ModuleName"
|
|
||||||
Write-Output "Repository URL: $RepositoryURL"
|
|
||||||
Write-Output "Old Repo: $OldRepo"
|
|
||||||
Write-Output "New Repo: $NewRepo"
|
|
||||||
Write-Output "Commands To Check: $($CommandsToCheck -join ', ')"
|
|
||||||
Write-Output "Log File Path: $LogFilePath"
|
|
||||||
Write-Output "API URL: $ApiUrl"
|
|
||||||
Write-Output "API Key: $ApiKey"
|
|
||||||
Write-Output "API Secret Key: $ApiSecretKey"
|
|
||||||
|
|
||||||
return $data
|
return $data
|
||||||
}
|
}
|
||||||
@@ -780,6 +773,7 @@ function GetHtmlContent {
|
|||||||
# Save and launch the HTML
|
# Save and launch the HTML
|
||||||
Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:8081/"
|
Start-Process "msedge.exe" -ArgumentList "--app=http://localhost:8081/"
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while ($listener.IsListening) {
|
while ($listener.IsListening) {
|
||||||
$context = $listener.GetContext()
|
$context = $listener.GetContext()
|
||||||
@@ -925,7 +919,7 @@ try {
|
|||||||
$response.OutputStream.Close()
|
$response.OutputStream.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"/quit" {
|
"/quit" {
|
||||||
if ($request.HttpMethod -eq "GET") {
|
if ($request.HttpMethod -eq "GET") {
|
||||||
$responseString = "Server shutting down."
|
$responseString = "Server shutting down."
|
||||||
@@ -952,6 +946,7 @@ try {
|
|||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "Error: $($_.Exception.Message)"
|
Write-Host "Error: $($_.Exception.Message)"
|
||||||
|
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
$listener.Stop()
|
$listener.Stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user