Trouble with hyperlink in UDTable

Product: PowerShell Universal
Version: 1.5.13

I’m trying to include links in my UDTable… Here is the code that I use to build an array of hashtables to be used for the table data:

$Results = @()

foreach($IP in $InputWorkstationLogIP) {
    if(Test-Connection $IP -Quiet) {
        try {
            $null = Invoke-RestMethod -Uri "http://${IP}:1234" -UseBasicParsing
            $LogLink = New-UDLink -Text "$IP Logs" -Url "http://${IP}:1234/logs/" -OpenInNewWindow
        }
        catch {
            Show-UDToast -Message $_.ToString() -Duration 10000
            $LogLink = 'N/A'
        }
    }
    else {
        Show-UDToast -Message "$IP is not online - not responding to ping"
    }
   
    $Results += @{
        Target = $IP
        LogLink = $LogLink
    }
}

$Session:WorkstationLogResults = $Results
Sync-UDElement -Id 'WorkstationLogResults'

New-UDDynamic -Id 'WorkstationLogResults' -Content {
    if($Session:WorkstationLogResults) {
        $Columns = @(
            New-UDTableColumn -Property Target -Title 'IP Address'
            New-UDTableColumn -Property LogLink -Title 'Log Link'
        )
        New-UDTable -Data $Session:WorkstationLogResults -Columns $Columns -PageSize 10 -Dense
    }
}

This is how I usually build tables, but I can’t get the UDLink to actually display a hyperlink. It just shows the below.

image

I took a look at the suggestions in this post, but the examples don’t work for me, and seem like they’re referencing the previous version of UD.

Any guidance is appreciated!

@nqui
needs to be done this way

$Columns = @(
    New-UDTableColumn -Property Link -Render { 
      
      New-UDLink -Text 'Link' -Url $EventData.LogLink
    }
)
3 Likes

Got it working with this! Thank you @wsl2001 !