From fc14845f46b39fc9345c4a9ccd659988cba235b5 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sat, 20 Dec 2025 21:02:04 -0500 Subject: [PATCH] Update samy.ps1 --- samy.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samy.ps1 b/samy.ps1 index 13e9fa5..95a313a 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -975,11 +975,19 @@ function Get-UIHtml { # # 2) Build the JS tasks array once (this is the only dynamic JS piece) # - $tasksJsAll = ( + $tasksJson = @( $Global:SamyTasks | ForEach-Object { - " { id: '$($_.Id)', handler: '/$($_.Name)', label: '$($_.Label)' }" + [pscustomobject]@{ + id = [string]$_.Id + handler = "/$([string]$_.Name)" + label = [string]$_.Label + } } - ) -join ",`n" + ) | ConvertTo-Json -Depth 4 + + # If you still want to keep the variable name "tasksJsAll", just store JSON in it: + $tasksJsAll = $tasksJson + # Human friendly branch label for UI $branchDisplay = switch ($Script:SamyBranch.ToLower()) {