controls/script-tags-html.ps1
function New-ScriptTagHTML { param ( [Parameter(Mandatory = $false)] $Script, [Parameter(Mandatory = $false)] $Tag, [Parameter(Mandatory = $false)] $UseToolTip ) if ($Null -eq $Tag -and $Null -ne $Script) { #No Tag - Yes Script $ScriptTags = Get-UAScriptTag -Script $Script } elseif ($Null -ne $Tag -and $Null -eq $Script) { #Yes Tag - No Script $ScriptTags = Get-UATag -Id $Tag.Id } elseif ($Null -eq $Tag -and $Null -eq $Script) { #No Tag No Script $ScriptTags = Get-UATag } if ($ScriptTags) { $ScriptTags | ForEach-Object { if ($_.Color -eq "#ffffff" -or $_.Color -eq "" -or $Null -eq $_.Color) { $TagColor = "#000000" } else { $TagColor = $_.Color } if($null -eq $_.Description -or $_.Description -eq "") { $NoDescription -eq $true } if($UseToolTip -ne $true -or $NoDescription -eq $true) { New-UDIcon -Icon tag -Color $TagColor $_.Name + " " } else { New-UDTooltip -TooltipContent {$_.Description} -Content { New-UDElement -Tag b -Content { New-UDIcon -Icon tag -Color $TagColor $_.Name + " " } } } } } else { "N/A" } } |