Update TGBeta.ps1
This commit is contained in:
14
TGBeta.ps1
14
TGBeta.ps1
@@ -1036,10 +1036,10 @@ try {
|
|||||||
Write-LogHybrid -Message "Unknown task: $TaskName" -Level "Warning"
|
Write-LogHybrid -Message "Unknown task: $TaskName" -Level "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Execute-PrioritizedTasks {
|
function Execute-PrioritizedTasks {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[array]$Tasks
|
[array]$Tasks
|
||||||
@@ -1054,10 +1054,10 @@ function Execute-PrioritizedTasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Output "All tasks completed."
|
Write-Output "All tasks completed."
|
||||||
}
|
}
|
||||||
|
|
||||||
# Route to handle incoming task execution request
|
# Route to handle incoming task execution request
|
||||||
if ($request.HttpMethod -eq "POST" -and $request.Url.AbsolutePath -eq "/executeTasks") {
|
if ($request.HttpMethod -eq "POST" -and $request.Url.AbsolutePath -eq "/executeTasks") {
|
||||||
try {
|
try {
|
||||||
$body = Get-Content -Raw -Path $request.InputStream | ConvertFrom-Json
|
$body = Get-Content -Raw -Path $request.InputStream | ConvertFrom-Json
|
||||||
$Tasks = $body.tasks
|
$Tasks = $body.tasks
|
||||||
@@ -1075,7 +1075,9 @@ if ($request.HttpMethod -eq "POST" -and $request.Url.AbsolutePath -eq "/executeT
|
|||||||
$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