Page with Variables in URL as described in the docs don't work

Product: PowerShell Universal
Version: 5.5.4

I tried to make use of Page with Variables in URL

But it seems that the /pagename/:variable syntax is seen as a URL path by PSU.
The page is not found under pagename and disappears from the menu.

Either this is a bug or I don’t get it.
Ideas?

its working. but you have to use double quotation marks instead of single one
something like this:

$Pages = @()
$Pages += New-UDPage -Name "Dashboard" -Url "/db/:user" -Content {
    New-UDTypography -Text "Dashboard for user: $User"
}

New-UDApp -Title 'Pages' -Pages $Pages

everything in single quotation marks is treated as pure string so no variable is passed.

i think this doc should be updates is misleading

Thanks,
I just copied the code, but same result.
The page does not appear at all in the menu

Instead, when I user the URL
https://myserver/playground/db/:user

The page appears.
It still takes the /:user literally.

I wouldnt expect it to appear in the menu unless you’re using -LoadNavigation on New-UDApp (and literally defining the menu item).
What happens when you goto https://myserver/playground/db/TestUser ? Do you see ‘TestUser’ on your page?
because if you’re going to https://myserver/playground/db/:user and seeing :user on your page, then that’s working as intended.

1 Like

something like this:

$Pages = @()
$users = @('test1', 'test2', 'test2')
$users | ForEach-Object {
    $var = $_
    
    $Pages += New-UDPage -Name "Dashboard $var" -Url "/db/$var" -Content {
        New-UDTypography -Text "Dashboard for user: $var"
        show-UDToast "$var"
    }
}
New-UDApp -Title 'Pages' -Pages $Pages

Thanks, now here we go.
That is what I expected.

Example
the “code”

$pages=@(

    $S="whatever1"; Get-UDPage -Name "mypage"

    $S="justthis2"; Get-UDPage -Name "mypage"
)

New-UDApp -Title 'playground' -Pages $pages 

The page got created with the GUI, but when you look at the “files” you will note that the $ sign got escaped like `$ .
So I edit the page file to:

New-UDPage -Url "/mypage/$S" -Name "mypage" -Content {
    "Variable: $S"
} -Title "....#$s".PadRight(24,".")

That is about the basuc functionality that I wanted.
Thanks all.