Update samy.ps1

This commit is contained in:
2025-12-20 19:27:27 -05:00
parent 2764943fb1
commit 6f94fa0b46

View File

@@ -978,10 +978,13 @@ function Get-UIHtml {
function Get-SamyTasks { function Get-SamyTasks {
[CmdletBinding()] [CmdletBinding()]
param() param(
[Parameter(Mandatory = $true)]
[string]$Url
)
try { try {
$json = Get-RemoteText -Url $Script:SamyTasksUrl $json = Get-RemoteText -Url $Url
if ([string]::IsNullOrWhiteSpace($json)) { if ([string]::IsNullOrWhiteSpace($json)) {
throw "Tasks JSON was empty." throw "Tasks JSON was empty."
} }
@@ -995,12 +998,13 @@ function Get-SamyTasks {
return $tasks return $tasks
} }
catch { catch {
Write-LogHybrid "Failed to load samy.tasks.json: $($_.Exception.Message). Falling back to embedded tasks." Warning UI -LogToEvent Write-LogHybrid "Failed to load tasks from ${Url}: $($_.Exception.Message)" Warning UI -LogToEvent
return $null return $null
} }
} }
#endregion UIHtml #endregion UIHtml