If I have this in the root of the pages folder, it loads it, it shows up in the pages tab, and I can browse to it. However, if I move it to a sub directory (such as Function1) to match the url, the page is no longer loaded.
I have tried a few different ways to get this to work without success, such as
Hey! So the URL is entirely separate from the actual local file path.
I personally don’t use Get-UDPage, but I did have a look at the parameters and I don’t see anything that allows you to specify a path, only a name, so I think you might be restricted on that front.
I however don’t use Get-UDPage, instead I have some code in my main dashboard/app .ps1 which uses get-childitem recursively on a “$Rootpath/content” folder, and everything in there is organised into sub folders and it just loads the pages in from there (I also have a commented json string which is used to fill out the parameters of new-udpage in each file, so i can keep everything in one place). My urls/page names are all relative to the parent domain though.
This way, I can keep all my pages nicely organised either by team, or function or both, and regardless of where I put them, as long as they’re in rootpath\content, they’ll load into the app.
I then define my navigation menu manually, and keep that organized in separate sections.
Nice, I like this approach. That means you can also add pages without needed to update the main app ps1. I am going to look into this for own setup. Thanks!
Yeah exactly! and all the parameters are in the page files themselves too. I just copy and paste an existing page, update the params, and then recycle the app and i’m good to go!
Oh, I forgot to mention, ConvertTo-HashTable is a custom function because you can’t splat form a PSCustomObject.