Get all pages of current (or given) dashboard

Product: PowerShell Universal
Version: 4.0.0-beta4

Hello once again
Im still struggling with PSU .
I created some dashboards. Set up authentication and authorization (kind of).
Next think i thought i need to design overall structure of my ‘SELFPORTAL’ applications
I used an idea of dashboard created by Adam called Landing Page (and slightly modified to my needs )
Its working , but I noticed that when every action is a separate dashboard, performance drops (mostly because every action has to refresh whole page not only page content). Memory consumption also was increased a lot. With few dashboard its not a problem, with dozen i think it will.
So I thought that I create only 3 or 4 generic Dashboards (like Active Directory, VM, SQL) and every action within will be a separate page.
Its working al lot better, mote responsive and faster. But I have problem with role based authorization.
When dealing with dashboards i used a method form Adam’s Landing Page:

Get-PSUDashboard -Integrated | Sort-Object Name  | ForEach-Object 
Protect-UDSection -Role $_.Role -Content $Content

And its working like it should - user see only dashboard that he has access to.

But when dealing with pages I cant get list of all pages from current (or any if its possible) dashboard.
So I cant enumerate it and set authorization with Protect-UDSection.
But authorization is working , form navigation menu i see only proper pages.
So is it possible to do some king of Landing Page but for pages not dashboards at all ?

Ok was able to simulate such behavior. But its not done in the "cleanest’ way.
First I read content of all dashboard pages:

$pages_files = Get-ChildItem '.\dashboards\Active Directory\pages'
$pages_files.BaseName | ForEach-Object {
	$pages +=( Get-UDPage -Name $_)

then with

$pages | ForEach-Object {
New-UDCard -Title '' -Content {
	New-UDTypography $_.Name 
 if ($_.Role) {
    Protect-UDSection -Role $_.Role -Content $Content
else {
    & $Content 

A make a cards with page names that user have access to and when its clicked I redirect to
proper page with Invoke-UDRedirect $_.Url

Its working, i had to move functions from page content to dashboard content.
But overall performance its similar because you had to read content of those files. With many of them i think it will be slower over time. But memory demand has drooped al lot.

Anyway still I think those commands should behave more like classic powershell command when you can get an object and pipe it to another command like

Get-PSUDashboard  -name 'Active Directory' | Get-UDPAge 

and then for each object do the magic :slight_smile: