Hey Guys,
Have not posted in a while and probably running a old version of PU but when I have the following:
New-UDDynamic -Id 'CitrixSessions' -Content {
$citrixsessionsColumns = @(
New-UDTableColumn -Property UserName -Title "User name"
New-UDTableColumn -Property SessionState -Title "Session State"
New-UDTableColumn -Property App -Title "Application"
New-UDTableColumn -Filter $false -Property session -Title "End Session" -Render {
$Item = $Body | ConvertFrom-Json
New-UDButton -Id "btn$($Item.SessionKey)" -Text "End Session" -OnClick {
Show-UDModal -Content {
New-UDTypography -Text "Waiting for session to end: "
New-UDProgress -Circular -Color Red
New-UDDynamic -id "WaitForSessionEnd" -content {
Do{
$issessionlive = if (Get-BrokerSession -AdminAddress $AdminAddress | where {$_.sessionkey -eq $item.SessionKey}) {$true}else{$false}
} while ($issessionlive -eq $true)
Hide-UDModal
Get-CitrixSessions
}
}
}
}
)
New-UDTable -filter -Data $session:citrixsessions -columns $citrixsessionsColumns
}
This code used to work, however $Item is currently Null so it cant find the session I am looking for, Have I missed something? Or is there something I can do to fix it as it does not seem to pull data from the $body.
The display of the table works fine.