controls/pipeline-grid.ps1

function New-PipelineGrid {
    param($Job)

    New-UDGrid -Title "Pipeline" -Headers @("Value", "Type", "Actions") -Properties @("Value", "Type", "Actions") -Endpoint {
       
        $JobPipelineOutputObjects= Get-UAJobPipelineOutput -Job $Job

        $JobPipelineOutputObjects | ForEach-Object {

            $PipeLineObject = $_
            $PipeLineObjectType = $_.GetType().Name
            $PipeLineObjectValue = If(($PipeLineObject | Get-Member).Name  -NotContains "ToString"){$PipeLineObject.Name}else{$PipeLineObject.ToString()}

            $PipeLineDetailsButton = New-UDButton -Text "" -Icon folder -OnClick {
                New-PipelineObjectDetailsModal -PipelineObject $PipeLineObject
            }

            $CopyStringButton = New-UDButton -Icon copy -OnClick {
                Set-UDClipboard -Data $PipeLineObjectValue
            }

            $ActionControls =  New-UDElement -Tag div -Content{
                if($PipeLineObjectType -eq "String")
                {
                    New-UDTooltip -Content{$CopyStringButton} -TooltipContent {"Copy String Value to Clipboard"}
                }
                else {
                    New-UDTooltip -Content{$CopyStringButton} -TooltipContent {"Copy Value to Clipboard"}
                    " "
                    New-UDTooltip -Content{$PipeLineDetailsButton} -TooltipContent {"Show Pipeline Object Details"}
                }
                
            }
   
            [PSCustomObject]@{
                    Value = $PipeLineObjectValue
                    Type = $_.GetType().Name
                    Actions = $ActionControls
            }
            
        } | Out-UDGridData
    }
}