Code to use for included themes issue


#1

Hello,

Can anyone give me the command for using the current integrated themes?
I’m trying to use $MyDashboard = New-UDDashboard -Pages @($Page1, $Page2, $Page3, $Page4) -Title “Menu Dashboard” -Theme "Blue"
and I get error.
I thought I am using the correct coding for this?
If I remove the -Theme “” I can add cards, or other elements but whenever I re-add back in I get error.


#2

$theme = Get-UDTheme “Blue”

New-UDDashboard -Pages @(…) -Theme $Theme

This is what I do for it. :slight_smile:


#3

Jacob,

Thank you very much! :smile:
That worked perfectamundo!

I am pretty new to powershell and UD and did not understand the help info? I needed a :slight_smile: Get-Help Help-for-Help command.
:slight_smile:


#4

you should take a look in Docs


#5

Alon,

I got the commands from docs but just misunderstood the required syntax and usage.

I’m just a beginner.

I have docs page open while I’m in UD ps1 file.


#6

If we took some of the guts from GetThemeCommand.cs, and used them to create a string constructor in Theme.cs, the syntax could be simplified.

Desired behavior:

Using Namespace UniversalDashboard.Models

New-UDDashboard -Theme ([Theme]'Blue') ...

Should take someone a bit more familiar with C# and the UD source code than me a couple minutes. Just a thought.

Thanks,
Tim Curwick