New-udgrid is a new endpoint. This is like a new powershell session (runspace).
If you want to use variables in it, you must declare it in the endpoint Or you declare it as $cache:rst variables (must be happen in the inner dashboard code - I think) .
If you are using a US Dashboard version before 2.4 you also have to define more parameters (header + 1 I forgot) for the grid.
looks similar to the example I posted for someone else, glad you got it working, take time to read the annoucements adam makes as he talks about variables not displaying how you think in his latest blog post. Sorry I missed this post 10 days ago doh!
my here strings are @" "@ I see your using single quotes? Also looks like you putting evertyhing into an array with the $Data variable, not sure this would even work in an ISE session, have you tried that? Give me a quick moment and I will build a simple dashboard and show you how to make use of the end-point…2 moments i’ll be back
this worked for me for quering mysql db and display on grid
$global:DBServerGlobal= “DC07INVDBVW1.domain.local”
$Global:usernameGlobal = “Domain\svc” # User account with permissions to the server
$Global:passwordGlobal = “mypassword!” | ConvertTo-SecureString -asPlainText -Force
$Global:credentialGlobal = New-Object System.Management.Automation.PSCredential($usernameGlobal, $passwordGlobal)
$queryActive = @"
SELECT productname FROM assetmanagement.serverinventory WHERE 1=1 And ((Team=‘Police’) or (Team=‘Wes Team’) or
(Team=‘FourStar’)) AND (OS like’%Windows%’ OR OS= ‘VSPHERE ESXi’ OR OS=‘EMC SAN’) AND ProductAssetType=‘Server’ And
(ServiceStatus =‘Active’) ORDER BY productname ASC, Status ASC
"@