Variables outside of dashboard

Hi - newbie here, so this may sound like a dumb question. I am using UD to create an input form for use in other tools. I have my form setup and it seems to work fine.

My dumb question. How do I get the variables out of the dashboard to use in regular powershell operations?

Hi @richj
Welcome to the world of UD forums!

Depends, as to why? You can do pretty much everything from UD.

Even tho:
Try the following:
$variable | convertto-json | out-file c:\temp\outvar.json

and to import said variable to a console session or whatever:
$variable = get-content C:\temp\outvar.json | convertfrom-json

Any particular use cases?

1 Like

Thanks, BoSen29

I’m using the dashboard as a data entry form to fill out details for a terraform & DSC deployment. I’m going to want to launch terraform after I know I have answers (another issue to figure out) I’m going to need to ultimately send the info to a database. I was thinking about creating an object and storing the variable answers there and exporting the entire object.

Hey @richj after reading your explanation you could directly write to the database from UD. I have a SQL dashboard on my github page showing this.

Thanks @psDevUK,

Could you point me to the correct project for this on your github page?

Thanks again

Was outside on the iphone…I wanted to post the link, so here it is https://github.com/psDevUK/psUniversalDashboard this is an older dashboard, but this is linked to AD via a dedicated security group…then I use the $User variable to output the content, and make sure it’s in a format to go in the DB. Hope this helps.