Running old dashboards on new version

Product: PowerShell Universal
Version: 4.1.10

I have been using PSU dashboards for a couple of years now, but have always stayed on version 2.12.6. We are finally working to upgrade our production tenant, but the first step was to upgrade my localhost. After struggling with the installation, I renamed all of the directories in C:\ProgramData and C:\Program Files (x86) and was able to successfully install the new version. However, I am a little confused as to how everything is laid out.

For example, [this documentation page] (https://docs.powershelluniversal.com/v/v3/userinterfaces/dashboards/components#adding-components-to-dashboards) about Components contains screenshots for 2.x, and the Components button appears to now be missing.

I am also unable to successfully get an existing dashboard to run properly. I created a App using the GUI just as a test, and then edited the dashboards.ps1 file to contain an existing dashboard. Here is the file content:

New-PSUApp -Name "TestApp" -FilePath "dashboards\TestApp\TestApp.ps1" -BaseUrl "/app" -Authenticated -AutoDeploy -Description "Just a test"
New-PSUDashboard -Name "Testing-Dashboard" -FilePath "C:\Repos\Testing-Dashboard\Dashboard\dashboard.ps1" -BaseUrl "/dashboard/testing" -Framework "UniversalDashboard:Latest" -Environment 7.3.8 -Component @("UniversalDashboard.CodeEditor:1.1.1") -SessionTimeout 0 -Description "for various tests"

The only thing I updated was the Environment parameter, and that was the match the new name in the new GUI. Everything else was in the previous dashboards.ps1 file on version 2.12.6. I tried to add the CodeEditor component, but was unable to find the button (see above).

I am just trying to figure out how to get existing dashboards to run on a newer version as seamless as possible. Any kind of help would be greatly appreciated

Is your component installed in the “assets folder” described under Component Storage in that article? https://docs.powershelluniversal.com/v/v3/userinterfaces/dashboards/components#component-storage

No, but following the documentation I do not see how to even add a component. I had no problem doing it in 2.x, but the Add Components button does not appear in the newest version.

I also tried removing that parameter altogether, since I do not believe this dashboard uses CodeEditor, but I am still getting the same 500 error.

Here is the current line in dashboards.ps1, which auto-changed to New-PSUApp once I saved the settings in the GUI:

New-PSUApp -Name "Testing-Dashboard" -FilePath "C:\Repos\Testing-Dashboard\Dashboard\dashboard.ps1" -BaseUrl "/dashboard/testing" -Environment "7.3.8" -Credential "adraper"

You may have to share a sanitized version of your dashboard and/or page code. It’s possible a breaking change introduced since 2.12.6 has broken it. If nothing else, someone could try to reproduce the issue in their environment.

I am in the process of moving a Universal Dashboard 2 dashboard to PowerShell Universal 3/4 environment. It is a big change. Quite a few cmdlets have changed. The structure has too.

I would recommend creating a new PowerShell Universal 4.2 environment, then moving your code over page by page.

In my Dev environment I made my dashboards/apps using the GUI then pushed the dashboards.ps1 file to other environments. This worked.

1 Like

That worked for me. Thanks a lot for the help. Most of the dashboards are starting up. However I noticed some errors in the logs about the pages not being loaded properly. After doing some investigation I noticed a pattern where every failing dashboard had this in dashboard.ps1:

$Pages = New-Object System.Collections.Generic.List[hashtable]
Get-ChildItem (Join-Path -Path $PSScriptRoot -ChildPath 'pages') |ForEach-Object {
    $Pages.Add((. $PSItem.FullName))
}
$DashboardParams = @{
    Title = 'Service Desk Dashboard' 
    Pages = $Pages
    Theme = $Theme
}
New-UDDashboard @DashboardParams

This code goes into the Pages directory in the repository and dynamically adds the pages in a grid to the dashboard home page. The working dashboards manually define the $Pages variable with a UDContainer and UDGrid.

Do you see anything that might prevent the dashboard from starting up?

I would comment all the content out of your pages and see if they start up blank.

If they do start to uncomment your code.

I have a pretty large environment I’m converting.

I find:

  1. Grids are now tables

  2. row/columns are now grids

  3. icons are not strings they are now objects

    and a ton of other stuff.

I ended up pretty much starting from scratch and copying everything into a new page

Thats exactly what I was afraid of. Looks like I’ll have to reassess if the upgrade it worth the hassle. Thanks for the input