Update samy.ps1
This commit is contained in:
10
samy.ps1
10
samy.ps1
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user