added function Get-TaskHandlerName
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
function Get-TaskHandlerName {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
$Task
|
||||
)
|
||||
|
||||
# Prefer explicit handler properties if present
|
||||
foreach ($p in 'HandlerFn','Handler','Fn','Function','Script') {
|
||||
if ($Task.PSObject.Properties.Name -contains $p) {
|
||||
$v = [string]$Task.$p
|
||||
if (-not [string]::IsNullOrWhiteSpace($v)) { return $v }
|
||||
}
|
||||
}
|
||||
|
||||
# Fallback: task.Name (your server routes use Name)
|
||||
if ($Task.PSObject.Properties.Name -contains 'Name') {
|
||||
$v = [string]$Task.Name
|
||||
if (-not [string]::IsNullOrWhiteSpace($v)) { return $v }
|
||||
}
|
||||
|
||||
return $null
|
||||
}
|
||||
|
||||
#region Web: Remote Fetch Helpers
|
||||
|
||||
function Get-RemoteText {
|
||||
|
||||
Reference in New Issue
Block a user