From e2f2a72a7207d0ef77497a165e6d40c7cadca35e Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Wed, 21 May 2025 17:26:48 -0400 Subject: [PATCH] Update testTaskGate.ps1 --- testTaskGate.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/testTaskGate.ps1 b/testTaskGate.ps1 index f816d81..443c976 100644 --- a/testTaskGate.ps1 +++ b/testTaskGate.ps1 @@ -39,7 +39,8 @@ function Install-CyberQP { } # Utility for sending plain-text HTTP responses -function Respond-Text { param($Context, $Text) +function Respond-Text { + param($Context, $Text) $buffer = [Text.Encoding]::UTF8.GetBytes($Text) $Context.Response.ContentType = 'text/plain' $Context.Response.ContentLength64 = $buffer.Length @@ -50,15 +51,19 @@ function Respond-Text { param($Context, $Text) #region UI Generation function Get-UIHtml { - # Build checkbox HTML - $checkboxes = $Global:Tasks | ForEach-Object { - "" - } -join "`n" + # Build checkbox HTML (wrap pipeline in parentheses so -join applies to result array) + $checkboxes = ( + $Global:Tasks | ForEach-Object { + "" + } + ) -join "`n" # Build JS tasks array - $tasksJs = $Global:Tasks | ForEach-Object { - "{ id: '$($_.Id)', handler: '/$($_.Name)' }" - } -join ",`n " + $tasksJs = ( + $Global:Tasks | ForEach-Object { + "{ id: '$($_.Id)', handler: '/$($_.Name)' }" + } + ) -join ",`n " $html = @"