Migrate from V2.9 to V3 and PowerShellUniversal

Hi,

I need some help moving forward with PowerShellUniversal. I love the new setup but it is a lot of work to convert my old dashboards (please prove me wrong).

Challeng list:

  1. I havning problem`s with loading functions. Before i loaded all my functions with . (Join-Path
    $ScriptRoot “function.ps1”)

  2. Page vs Dashboard. How should the this be done in the new version? Before i had one dashboard with xx pages. Should i still use that or is it one page on dashboard? I found it more usefull because you cannot edit joind pages in the admin consol.

  3. Can some please make a universel convert :smiley: (2.9 - 3.0)

  4. How to set default Home page? I don`t want it to be the admin site.

  5. I don`t like the new module setup i got a lot of custom/non supported modules that i need to groom before i can get this up and running.

I love universel dashboard and invested a loot of hour in it in 2019 and 2020. But with this new version it all come to a stop. I need to get this new setup to work so i can start to create and update all my cool dashboards. Thanks.

/Kim

@MR-ITdude
i was using universal dashboard before and i thought migrating to PSU will be time consuming but in fact i was able to do it in couple of hours.
in regard to your challenge list below are some advices that might help you in your migration.

1- you can add your functions to the main dashboard file or to a custom component or create a powershell module for these functions that you can use with psu,its up to you which route you want to use to add these functions.
2-PSU work with one files or multi files like before so the pages can be separate and can be in one file.
3-there is no way to do so since both versions are different in cmdlets, v3 for example no longer uses grids and if you have grids before you need to re code your script to use tables also ud-cards is a little bit different in v3 than in v2, so its all about what components you have used in v2 and if its still the same or need rewrite in v3.
4-the admin site is only accessible when you type /admin , if you create a dashboard and you dont want to give it a name like /dashboard just use “/” this way when you type the fqdn it will immediately launch the dashboard. more info here Dashboards - PowerShell Universal

2 Likes

Thanks for your reply @wsl2001 .

I will try again to see if I can get this running.

  1. Omg so easy :sweat_smile:

Not to hijack this thread, but figured it would be easier instead of starting my own.

Also trying to migrate to Powershell Universal and for the life of me I can’t get pages to work in separate files at all.

Another issue I’m having is with using scripted jobs instead of scheduled endpoints with the PSUCache command. The cached values don’t seem to be accessible. Using the example of Get-Date works fine, but trying to do anything more robust is failing.

Anyone have any tips or larger examples? Thanks!

1 Like

Do you have some code snippets you can share?

For the pages, can you show me what you’re trying to do? You should be able to do this.

For the cache, we have an issue with items over 4MB in size. Set-PSUCache ResourceExhausted when setting large data · Issue #74 · ironmansoftware/issues · GitHub

Ah, alright. That makes sense for the cache then. Trying to pull a pretty large list from Citrix for it. Thanks!

As for the pages, I’ve got the following just as a quick test:

$Pages = @()
$Pages += New-UDPage -Name ‘page1’ -Content {
. “C:\PSU\Repository\pages\page1.ps1”
} -NavigationLayout permanent -LoadNavigation $Navigation
$Pages += New-UDPage -Name ‘page2’ -Content {
New-UDTypography -Text “Page2”
} -NavigationLayout permanent -LoadNavigation $Navigation

The content of page1.ps1

New-UDPage -Name ‘page1’ -Title ‘Page one!’ -Content {
New-UDCard -Title ‘Simple Card’ -Content {
‘This is page 1’
}
}

So obviously Page2 loads and shows the text. Page1 remains blank. No errors in the log to indicate an issue.

Try this:

$Pages = @()
$Pages += . “C:\PSU\Repository\pages\page1.ps1”
$Pages += New-UDPage -Name ‘page2’ -Content {
New-UDTypography -Text “Page2”
} -NavigationLayout permanent -LoadNavigation $Navigation

It looks like you are wrapping a page in a page.

You could also do:

$Pages = @()
$Pages += New-UDPage -Name ‘page1’ -Content {
. “C:\PSU\Repository\pages\page1.ps1”
} -NavigationLayout permanent -LoadNavigation $Navigation
$Pages += New-UDPage -Name ‘page2’ -Content {
New-UDTypography -Text “Page2”
} -NavigationLayout permanent -LoadNavigation $Navigation

And then page one would be

New-UDCard -Title ‘Simple Card’ -Content {
‘This is page 1’
}
1 Like

That did the trick. So obvious! In my original dashboard my pages all started with New-UDPage, so I didn’t consider that at all.

Thanks adam.

1 Like