Update samy.ps1
This commit is contained in:
26
samy.ps1
26
samy.ps1
@@ -696,9 +696,29 @@ function Get-SamyTasks {
|
||||
$tooltipRaw = $t.Tooltip
|
||||
}
|
||||
|
||||
# Normalize tooltip to a single string (prevents array -> "everything joined" tooltips)
|
||||
$tooltip = if ($tooltipRaw -is [string]) {
|
||||
$tooltipRaw
|
||||
# Normalize tooltip to a single string
|
||||
$tooltip = if ($tooltipRaw -is [string]) {
|
||||
$tooltipRaw
|
||||
}
|
||||
elseif ($tooltipRaw -is [System.Collections.IEnumerable] -and -not ($tooltipRaw -is [string])) {
|
||||
$arr = @($tooltipRaw | ForEach-Object { [string]$_ } | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
|
||||
|
||||
if ($arr.Count -eq 1) {
|
||||
$arr[0] # single tooltip item
|
||||
}
|
||||
else {
|
||||
[string]$t.Label # array => treat as bad data, fallback to label
|
||||
}
|
||||
}
|
||||
else {
|
||||
[string]$tooltipRaw
|
||||
}
|
||||
|
||||
# Fallback: tooltip defaults to label
|
||||
if ([string]::IsNullOrWhiteSpace($tooltip)) {
|
||||
$tooltip = [string]$t.Label
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($tooltipRaw -is [System.Collections.IEnumerable] -and -not ($tooltipRaw -is [string])) {
|
||||
# Tooltip was an array/list -> join it explicitly (or pick first)
|
||||
|
||||
Reference in New Issue
Block a user