Dashboard with Multiple Pages - 1.2.8

Hi, after checking the documentation for Pages (https://docs.ironmansoftware.com/dashboard/dashboards/building-dashboards#pages) I can see that it should be possible to have multiple pages in a dashboard. However, when I do this (using exactly the same code as in the docs), I get the following error:

[07-13-20 02:21:38 PM] Startup: Item has already been added. Key in dictionary: 'defaultHomePage'  Key being added: 'defaultHomePage' 
[07-13-20 02:21:38 PM] Startup: at <ScriptBlock>, C:\ProgramData\UniversalAutomation\Repository\Server Health.ps1: line 2
at <ScriptBlock>, <No file>: line 1 
[07-13-20 02:21:38 PM] Startup:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Management.Automation.HashtableOps.Add(IDictionary lvalDict, IDictionary rvalDict)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 

It almost seems that PSU automatically assigns the dashboard a default homepage but fails when multiple pages exist. Any ideas on what I am doing wrong here? Thanks!

Hi Zach,

I fixed that example. It should be:

$Pages = @()
$Pages += New-UDPage -Name 'My Home Page' -Content {}
$Pages += New-UDPage -Name 'Diagnostics' -Content {}
New-UDDashboard -Pages $Pages -Title 'Dashboard'
1 Like

Thanks Adam, that did the trick! I appreciate your help.