Unbale to Load or Edit App Pages in PowerShell Universal

Product: PowerShell Universal
Version: 1.4.6

I’m using PowerShell Universal version 5.5.3 and recently installed its extension on VS Code.

I wanted to implement pages within an existing app, but whenever I choose to create an app either from VS Code or PowerShell Universal dashboard the page file gets stored locally and it does not load the page. I’ve also found that if I edit the page in VS Code, it does not update to PowerShell Universal.

Please advise.

Has anyone been able to implement App Pages using this documentation:

New-UDPage -Name ‘Users’ -Url ‘/users’ -Content {
New-UDButton -Text ‘What page is this?’ -OnClick {
Show-UDToast $UDPage
}
} -AutoInclude

“Pages are automatically added to apps with the -AutoInclude parameter. Simply call New-UDApp in the root of your app’s PS1 file.”

No this doesn’t work. I have the same issue.

Pages created in the Pages tab aren’t accessible, even if they have the AutoInclude switch.

# Main app
New-UDApp -Content { 'Hello, world!' }

# Page
New-UDPage -Url "test" -Name "test" -Content {
    'Hello, world!'
} -AutoInclude

(this is the auto-generated code when you create a new app and app’s page)

I need to includes them directly in the main file (New-UDApp -Pages @(…)) for them the work.

Surely I’m missing something, but I don’t know what.

@Zoddo i think the problem with your example is that used -Content. And that prevents the pages from loading, based on that the -Pages and -Content have different parameter sets.

Failed to get dashboard. Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided. System.Management.Automation.RuntimeException

try this:


# Mainapp file
New-UDApp

# Pagefile1
New-UDPage -Url "test" -Name "test" -Content {
    'Hello, world!'
} -AutoInclude

Ok, that was it.

I already tried it before posting, and despite restarting the app it didn’t work.
Looks like Universal required a full restart, because when I restarted it today, the page was working without doing any other modification.

Not sure what happened, I can’t repro this “bug” when adding then removing -Content from New-UDApp.